Forum Moderators: phranque
Basically, the rules rewrite calls such as
[subdomain.example.com...] --->http://www.example.com/script.php?c=subdomain
[subdomain.example.com...] --->http://www.example.com/script.php?c=subdomain&items=10
[subdomain.example.com...] --->http://www.example.com/script.php?c=subdomain&s=subdir
[subdomain.example.com...] --->http://www.example.com/script.php?c=subdomain&s=sub-dir&items=10
The odd thing is everything worked properly until my host did a recent server patch. Now, all the rules work except for the rule that rewrites [subdomain.example.com...] to http://www.example.com/script.php?c=subdomain
All the other rules work. Here are my rules
RewriteCond %{HTTP_HOST}!^www\.example\.net [NC]
RewriteCond %{HTTP_HOST}!^example\.net [NC]
RewriteCond %{REQUEST_URI} ([0-9]+)$
RewriteCond %{REQUEST_FILENAME}!-d
RewriteCond %{REQUEST_FILENAME}!-f
RewriteRule ^(.+) %{HTTP_HOST}/$1 [C]
RewriteRule ^(.+)\.example\.net/([A-Za-z\-]+)/([0-9]+) test2.php?c=$1&s=$2&items=$3 [L]
The above rule works perfectly.
RewriteCond %{HTTP_HOST}!^www\.example\.net [NC]
RewriteCond %{HTTP_HOST}!^example\.net [NC]
RewriteCond %{REQUEST_URI} ^/([0-9]+)$
RewriteCond %{REQUEST_FILENAME}!-d
RewriteCond %{REQUEST_FILENAME}!-f
RewriteRule ^(.+)\.example\.net/([0-9]+) test2.php?c=$1&items=$2 [L]
Above works perfectly
RewriteCond %{HTTP_HOST}!^www\.example\.net [NC]
RewriteCond %{HTTP_HOST}!^example\.net [NC]
RewriteCond %{REQUEST_URI}!(.*)/([0-9]+)$ [NC]
RewriteCond %{REQUEST_FILENAME}!-d
RewriteCond %{REQUEST_FILENAME}!-f
RewriteRule ^(.+) %{HTTP_HOST}/$1 [C]
RewriteRule ^(.+)\.example\.net/(.+[^/])$ test2.php?c=$1&s=$2 [L]
Above works perfectly.
RewriteCond %{HTTP_HOST}!^www\.example\.net [NC]
RewriteCond %{HTTP_HOST}!^example\.net [NC]
RewriteCond %{REQUEST_FILENAME}!test2(.+) [NC]
RewriteRule ^(.+) %{HTTP_HOST}/$1 [C]
RewriteRule ^(.+)\.example\.net/ test2.php?c=$1 [L]
This rules doesn't.
Any idea as to what could be going wrong? My host knows that something in the patch has caused this, but is not being very helpful saying the patch was necessary...sorry.
RewriteCond %{REQUEST_URI} !/test2\.php [NC]
RewriteCond %{HTTP_HOST} !^www
RewriteCond %{HTTP_HOST} ^(.+)\.example\.net
RewriteRule .* /test2.php?c=%1 [L]
Jim