Forum Moderators: phranque
Options +FollowSymlinks -indexes
RewriteEngine on
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST}!^www\.trshady\.com [NC]
RewriteRule ^(.*)$ [trshady.com...] [R=301,L]
Which re-directs all non www. urls to www.domain etc
Now this works fine for most urls on my site but in directorys where I have a .htacess with something like this:
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(.*)/$ view.php?title=$1
The re-dicrect fails to work.
Any ideas why?
Thanks
When redirecting a url from non www. to www instead of changing the url it redirects to what the mod_write disguises.
So where the url looks like this:
domain.com/folder/keyword/
it re-directs to this:
www.domain.com/index.php?variable=keyword
Any ideas why this is happening?
The simplest way to fix it is to put both rules together in one .htaccess file, so that you can explicitly control their order of execution.
So, either duplicate the domain redirect in the subdirectory (and turn inherit back off), or move the static-dynamic URL rewrite to .htaccess in root.
Jim