Report this

What is the reason for this report?

SymLinks not being followed in htaccess

Posted on August 3, 2013

I have CentOs with Apache.

In my httpd.conf I have

<Directory /> Options FollowSymLinks AllowOverride None </Directory>

and further down

<VirtualHost *:80> ServerAdmin me@mydomain.com DocumentRoot /var/www/mydomain.com/public_html ServerName www.mydomain.com ServerAlias mydomain.com ErrorLog /var/www/mydomain.com-error_log CustomLog /var/www/mydomain.com-access_log common <Directory /> Options +FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>

And in my .htaccess in my public_html folder I have at the top:

RewriteEngine On Options +FollowSymLinks

However, the links (e.g. a RewriteRule $ /error/mypage.htm [R=302,L]) are generated as:

/var/www/error/mypage.htm

rather than:

/var/www/mydomain.com/public_html/mypage.htm

any ideas?

thanks



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

oki given up on trying to escape this, grr

Hi, well the one I’m using has one. Isn’t that enough? I’m not quite sure what AllowOverride All entails, is it safe to enable all this stuff? <br> <br>So with a ScriptAlias I now seem to have CGI path correct and executable, latest problem is I don’t have permissions to access (I have checked chmod and “apache” is the group user). <br> <br>Also all other files are still inaccessible due to incorrect path, as previously. <br> <br>I feel like I’m going round in circles!

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.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.