Forum Moderators: phranque
In other words:
[domain.com...]
redirects to [domain.com...]
but
[domain.com...]
does NOT redirect to
[domain.com...]
I am using the exact code posted in that thread. There is an .htaccess in the subdirectory, which is required...does the second .htaccess cause the first one to be completely ignored?
It could, if it contains "RewriteOptions [httpd.apache.org] none".
Or it may be overriding the top-level .htaccess file's actions.
It is usual to answer a question like this with two questions:
1) Did the top-level rewrite code stop working at the same time that you changed or added something else?
2) What happens if you (temporarily) un-do that change?
Once you've established causality, discussion and remediation is much easier...
Jim
ReWriteEngine On
Options +FollowSymlinks -Indexes 1) Did the top-level rewrite code stop working at the same time that you changed or added something else?
I could have sworn that it (subdirectories) was working just fine before and after making the change..but maybe I just didn't test it properly. Basically, I'm not sure. What I do know happened is I updated cpanel. Maybe that could have done something?
2) What happens if you (temporarily) un-do that change?
Forgot to mention that undoing that change does not fix the problem.
Once you've established causality, discussion and remediation is much easier...
Whether you continue to use cPanel or not, always keep backups of your .htaccess file, so that if you or cPanel clobbers some settings, you can copy them back.
Jim
the .htaccess in the /www directory looks like this:
Options +FollowSymlinks -Indexes
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com [NC,OR]
RewriteCond %{HTTP_HOST} ^192\.168\.1\.1
RewriteRule ^(.*) http://www.example.com/$1 [R=301,L]
RewriteRule ^t([0-9]+)-p([0-9]+)-h([a-z0-9]+)-(.*).html$ http://www.example.com/subdir/file.php?t=$1&page=$2&highlight=$3 [R=301,NC,L]
RewriteRule ^t([0-9]+)-p([0-9]+)-(.*).html$ http://www.example.com/subdir/file.php?t=$1&page=$2 [R=301,NC,L]
RewriteRule ^t([0-9]+)-(.*).html$ http://www.example.com/subdir/file.php?t=$1 [R=301,NC,L]
and the .htaccess in the subdir folder is messing it all up.
Even if I just leave the following in it, the redirect gets messed up (under certain, but not all conditions):
Options +FollowSymlinks -Indexes
ReWriteEngine On
Why should those 2 lines matter?