Forum Moderators: phranque
GeoIPEnable On
RewriteEngine On
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^CA$ [NC]
RewriteRule ^(.*)$ http://subdomain.example.com/cad/$ [R,L]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
</IfModule>
# END WordPress
#
# <Files wp-config.php>
# order allow,deny
# deny from all
# </Files>
# order deny,allow
# deny from all
# allow from 11.111.111.11
# allow from 22.22.222.22
# directory browsing
# Options All -Indexes
# <Files ~ "^.*\.([Hh][Tt][Aa])">
# order allow,deny
# deny from all
# satisfy all
# </Files>
RewriteEngine On
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^CA$ [NC]
RewriteRule ^(.*)$ http://subdomain.example.com/cad/$ [R,L]
Some use it, others don't.
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
GET /cad/$
Those are the rules WordPress wrote by itself.
GeoIPEnable On
RewriteEngine On
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^CA
RewriteCond %{REQUEST_URI} !^/cad/
RewriteRule ^(.*)$ http://somesite.example.com/cad/$1 [R=301,L]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^CA
RewriteCond %{REQUEST_URI} !^/cad/
RewriteRule ^(.*)$ http://somesite.example.com/cad/$1 [R=301,L]
I commented out the rules, and was still getting the 500 error.
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
# RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^CA
RewriteCond %{REQUEST_URI} !^/cad/
RewriteRule ^(.*)$ http://clientarea.example.com/cad/$1 [R=301,L]
... "GET /cad/ HTTP/1.1" 301 263 ...
... "GET /cad/index.php HTTP/1.1" 301 263 ...
... "GET / HTTP/1.1" 301 254 ...
(.+) i don't see a loop
RewriteRule ^index\.php$ - [L]
[edited by: phranque at 3:49 am (utc) on May 28, 2014]
[edit reason] exemplified domain [/edit]
RewriteCond %{REQUEST_URI} !\.(jpe?g|gif|bmp|png|tiff|css|js)$ [NC]
<snip>
RewriteRule ^(.*)$ http://clientarea.example.com/cad/$1 [R=301,NC,L]
RewriteRule ^([^.]+(\.html|/))?$ http etcetera It's something else.