Jump to content

Anyone having issue with mod_rewrite for wampserver?


pneudralics

Recommended Posts

I've enabled it in the apache module.

 

Check phpinfo() and it's there.

 

I've done this..

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #

 

I still can't get it to rewrite

Options +FollowSymLinks
RewriteEngine On

RewriteRule ^home\.php$ index.php 

 

The way I'm getting to index.php is a link on the page or typing it manually in the url. Restarted wamp several times.

Where have you placed this code

Options +FollowSymLinks
RewriteEngine On

RewriteRule ^home\.php$ index.php 

 

You should of placed it within a .htaccess file (thats the exact name) which should be located into root of WAMP's www folder (eg C:/wamp/www). You do not need to restart Apache each time you modify the .htaccess file, as it is read on every http request to the server. You only need to restart Apache if you make changes to the main configuration file(s).

  • 1 year later...

Just to confirm, you are testing this by using the URL http://localhost/home.php correct? If you aren't, you should be because that rule will take requests for home.php and display index.php. If you are and it's not working, the rewrite pattern should probably be...

 

RewriteRule ^home\.php$ /index.php 

 

Though this should cause a 404 error as mentioned previously. Is Wampserver perhaps not set-up to throw proper errors?

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.