ClearWebSolutions/codes/master/modules/default/.htaccess - Htaccess File

ClearWebSolutions/codes/master/modules/default/.htaccess

RewriteEngine On

# Home page for particular languages
RewriteCond %{REQUEST_URI}      ^/codes/([a-z]?[a-z]?)/$ [NC]
RewriteRule ^(.+)$ /codes/index.php?lang=%1 [L,QSA]

# Home page for particular languages
RewriteCond %{REQUEST_URI}      ^/codes/([a-z]?[a-z]?)$ [NC]
RewriteRule ^.+$ /codes/index.php?lang=%1 [L,QSA]

# Remove trailing slashes.
# e.g. example.com/foo/ will redirect to example.com/foo
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ /$1 [R=permanent,QSA]

# Redirect to PHP with language param
# e.g. example.com/en/foo will display the contents of example.com/foo.php?lang=en
RewriteCond %{REQUEST_URI}      ^/codes/([a-z]?[a-z]?)/(.*)$ [NC]
RewriteRule ^(.+)$ /codes/%2.php?lang=%1 [L,QSA]

# Redirect to PHP if it exists.
# e.g. example.com/foo will display the contents of example.com/foo.php
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+)$ $1.php [L,QSA]

On Github License

Files

Download PDF of Htaccess file
REQUEST_FILENAME, REQUEST_URI

Comments

Apache