Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,608
    Thanks
    6
    Thanked 997 Times in 970 Posts

    URL rewriting not working on localhost

    hmm, I can’t seem to get pretty URLs working on my local server, I just get “404” errors. The default httpd.conf has this:
    Code:
    <Directory />
        Options FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
    </Directory>
    and then I have a user specific config file where I have this:
    Code:
    Options +Includes
    <Directory "/Users/[user name]/Sites/">
        Options Indexes MultiViews +Includes
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
    
    NameVirtualHost *:80
    <VirtualHost *:80>
        DocumentRoot "/Users/[user name]/Sites/example"
        ServerName example.dev
    </VirtualHost>
    …
    (more virtual host names here)
    …
    This Sites directory is basically the web root of my local server. In that I have different sub directories for all my testing sites. These sites have .htaccess files in their root directories where the rewriting is defined, among other things. It is obviously rewriting and the error log has no errors except the 404s. What’s my problem?

  • #2
    New to the CF scene
    Join Date
    Apr 2012
    Posts
    4
    Thanks
    1
    Thanked 1 Time in 1 Post
    The line "AllowOverride None" would prevent Apache to read .htaccess

    http://httpd.apache.org/docs/2.0/mod...#allowoverride

  • #3
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,608
    Thanks
    6
    Thanked 997 Times in 970 Posts
    This is definitely not the problem because the .htaccess file is being read; as I said, it is rewriting the URL, it’s just not showing the page. If I change AllowOverride to All I’m getting error 403 instead of 404 – not much achieved here.

    Any other possibilities?

    Edit: I’m sorry, I was (partly) wrong. I do indeed have to change AllowOverride to All but I also had to add FollowSymLinks to the Options rule. It’s working now, woohoo!
    Last edited by VIPStephan; 04-19-2012 at 11:31 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •