A question can only have one accepted answer. Are you sure you want to replace the current answer with this one?
Changed your mind?
You previously marked this answer as accepted. Are you sure you want to unaccept it?
SymLinks not being followed in htaccess
Posted August 3, 201323.2k views
I have CentOs with Apache.
In my httpd.conf I have
and further down
CustomLog /var/www/mydomain.com-access_log common
Allow from all
And in my .htaccess in my public_html folder I have at the top:
However, the links (e.g. a RewriteRule $ /error/mypage.htm [R=302,L]) are generated as:
So DirectoryIndex is where it looks for an initial file? I don't think that applies as I have mod_rewrite doing everything in the background, i.e. it redirects from base url, or any index file (index.html, index.php etc.) to index.cgi
I've added "allowoverride all" to all my virtual hosts (most of which are empty i should point out), it has brought me back an old error I previously had but resolved. I get apache test page and error:
Directory index forbidden by Options directive: /var/www/mydomain.com/public_html/
Hi, Thanks managed to get it sorted now with your help and other bits of fiddling around. The allowoverride all fixed it but there were some other issues I had to resolve first to get it working properly :)
So I realised what was causing the problem of the URLs not being found. I had "RewriteEngine On" at the top of my .htaccess and removing this fixed it (I noticed this after I accidentally uploaded an old version and ran into the same problem again).
OK I tell a lie, I'm getting myself confused. I did have this working last night but its no longer working when i got up this morning. The RewriteEngine being off just redirected to index.html hence my confusion.
So the rest of the site functions fine it just seems to be the ErrorDocument in particular that is perhaps getting blocked by .htaccess. I managed to get it to work by moving them from /var/www/mydomain.com/public_html/error to /var/www/error/mydomain and changing the httpd.conf paths e.g.