Mobile app version of vmapp.org
Login or Join
Gretchen104

: Apache, Rewrite Rule and Directories I'm using the current virtual host: <VirtualHost *:80> ServerAdmin webmaster@mysite ServerName example.co.uk ServerAlias www.example.co.uk

@Gretchen104

Posted in: #Apache #Apache2 #ModRewrite #Url #Virtualhost

I'm using the current virtual host:

<VirtualHost *:80>
ServerAdmin webmaster@mysite
ServerName example.co.uk
ServerAlias example.co.uk DocumentRoot /home/example.co.uk/htdocs/
<Directory /home/example.co.uk/htdocs/>
Options -Indexes FollowSymlinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/example.co.uk/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/example.co.uk/access.log combined
</VirtualHost>


Within the .htaccess in the root I'm using RewriteRule ^enquiries$ /enquiries.php amoung several other redirects.

Somehow I have also a directory named "enquiries" (/home/example.co.uk/htdocs/enquiries/), and when I hit the URL example.co.uk/enquiries I get:

HTTP/1.1 301 Moved Permanently
Date: Mon, 10 Dec 2012 18:53:37 GMT
Server: Apache/2.2.16 (Debian)
Location: www.mysite.co.uk/enquiries/ Vary: Accept-Encoding
Content-Type: text/html; charset=iso-8859-1


Any browser would also display the directories content. I could easily rename the folder and get it sorted, but I would like to understand what's going on here. What would be the correct way to configure Apache in a way that it wont behave this way?

If I did not explain myself clearly, please feel free to ask more questions, I'd be happy to answer them. Thanks!

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Gretchen104

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme