by [email protected] » Thu May 05, 2011 2:56 pm
Hi Ed,
Here you go ! ... I will look into changing the 2 letter URL's Cheers
Options +FollowSymLinks
RewriteEngine On
# gtranslate config
RewriteRule ^([a-z]{2}|zh-CN|zh-TW)/([a-z]{2}|zh-CN|zh-TW)/(.*)$ /$1/$3 [R=301,L] RewriteRule ^([a-z]{2}|zh-CN|zh-TW)/([a-z]{2}|zh-CN|zh-TW)$ /$1/ [R=301,L] RewriteRule ^([a-z]{2}|zh-CN|zh-TW)/(.*)$ /gtranslate/translate.php?lang=$1&url=$2 [L,QSA] RewriteRule ^([a-z]{2}|zh-CN|zh-TW)$ /gtranslate/translate.php?lang=$1 [L,QSA]
#RewriteBase /
## Back-end access (only for temp URLs)
RewriteCond %{HTTP_HOST} ^.+\.directrouter\.co(m|\.uk)$ [OR]
RewriteCond %{HTTP_HOST} ^.+\.\x72\x6F\x63\x68\x65\x6E\.\x63\x6F(m|\.uk)$
RewriteCond %{REQUEST_URI} (\/~.+?\/)
RewriteRule ^(administrator[/]?)$ %1$1/index.php [L]
### Server protection rules, by Nicholas K. Dionysopoulos (Oct 2009)
## Add exceptions in the area between the dashed lines
## ----------
## Example rule: allow access to plugins/system/GoogleGears/gears-manifest.php. Remove the
## hash in front of the next line to enable
# RewriteRule ^(plugins/system/GoogleGears/gears-manifest.php)$ $1 [L]
## ----------
## If you use a template which requires direct access to PHP files inside its directory
## (for example RocketTheme's templates) uncomment the following line:
# RewriteRule ^(administrator/templates/.*\.php)$ - [L]
## DO NOT MODIFY BELOW THIS LINE!
## Back-end protection
RewriteRule ^(administrator[/]?)$ $1/index.php [L]
RewriteRule ^(administrator/index.htm[l]?)$ - [L]
RewriteRule ^(administrator/index.php)$ - [L]
RewriteRule ^(administrator/index[2-3].php)$ - [L]
RewriteRule ^(administrator/(components|modules|images|templates)/.*\.(jpe[g,2]?|jpg|png|gif|bmp|css|js|swf|htm[l]?))$ - [L]
RewriteRule ^(administrator/.*\.php(.*))$ - [L]
RewriteRule ^administrator/(.*)$ index.php [F,L]
## Explicitly allow access only to XML-RPC's xmlrpc/index.php or plain xmlrpc/ directory
RewriteRule ^xmlrpc[/]?$ xmlrpc/index.php [L]
RewriteRule ^xmlrpc/index\.php$ xmlrpc/index.php [L]
RewriteRule ^xmlrpc/(.*)$ xmlrpc/index.php [F,L]
## Disallow front-end access for certain Joomla! system directories
RewriteRule ^(includes/js/.*)$ - [L]
RewriteRule ^(cache|includes|language|libraries|logs|tmp)/.*$ index.php [F,L]
### Server protection ENDS HERE
########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
## End of deny access to extension xml files
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End - Rewrite rules to block out some common exploits
########## Begin - Joomla! core SEF Section (only for temp URLs)
#
RewriteCond %{HTTP_HOST} ^.+\.directrouter\.co(m|\.uk)$ [OR]
RewriteCond %{HTTP_HOST} ^.+\.\x72\x6F\x63\x68\x65\x6E\.\x63\x6F(m|\.uk)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC]
RewriteCond %{REQUEST_URI} (\/~.+?)\/
RewriteRule (.*) %1/index.php [C]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
########## End - Joomla! core SEF Section (only for temp URLs)
########## Begin - Joomla! core SEF Section
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
########## End - Joomla! core SEF Section