Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am currently trying to get a webpage of mine running on my local machine. Strangely though, albeit I do use the exact same Directives and RewriteRules, what works on my server, does not work on my local machine.

What happens is that every request to a file is handled as a request to a directory, e.g.

http://mysite/img/logo.png -> http://mysite/img/logo.png/
http://mysite/css/main.css -> http://mysite/css/main.css/
http://mysite/subfolder/page.html -> http://mysite/subfolder/page.html/

My Directives are:

DocumentRoot /var/www/url/to/site
<Directory /var/www/url/to/site/>
  Options none +FollowSymLinks
  AllowOverride All
  allow from all
</Directory>

My Rewrite Rules are:

RewriteEngine on 
RewriteRule ^/?([a-zA-Z0-9-]+)(\/)?$ $1.html
RewriteRule ^/?(natur)?(wohl)?klang/([a-zA-Z0-9-]+)(\/)?$ /$1$2klang/$3.html
share|improve this question
    
Those rewrite rules don't do redirects. It must be something else. Don't forget to look for .htaccess files or switch AllowOverride to none. –  Ladadadada Aug 4 '13 at 14:16

1 Answer 1

I managed to get it working by changing the Directory Directive from

<Directory /var/www/url/to/site/>

to

<Directory /var/www/url/to/site>

(note the missing trailing slash).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.