Forum Moderators: phranque
right now my.domain.com is rewritten to use 'my' as a variable.. everything works fine, but if i try to make another rule such as my.domain.com/view/99/ the other rules do not work. this is my current rewrite:
rewriteEngine On
rewriteCond %{REQUEST_URI}!^/index\.php
rewriteCond %{HTTP_HOST}!^www\.
rewriteCond %{HTTP_HOST} ^(.+)\.domain\.com
rewriteRule .* /index.php?v=%1 [L]
rewriteRule ^/(view)/([0-9]+)/?$ view.php?v=%1&a=$2 [L]
-eof
i tried to move the first rule under the second rule but i get a 500 error. any help is much appreciated!
For use in /.htaccess:
RewriteEngine on
#
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTP_HOST} ^([^.]+)\.+domain\.com
RewriteRule ^view/([0-9]+)/?$ view.php?v=%1&a=$1 [L]
#
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTP_HOST} ^([^.]+)\.+domain\.com
RewriteRule !^(index¦view)\.php$ /index.php?v=%1 [L]
Jim