menu

Questions & Answers

mod_rewrite will not rewrite, no errors in logs

I am trying to rewrite

http://localhost/pex/index.php?p=login

to

http://localhost/pex/login

If the re get is set

http://localhost/pex/index.php?p=login&re=users

to

http://localhost/pex/login/re/users

I used http://www.generateit.net/mod-rewrite/ which suggested:

RewriteEngine On
RewriteRule ^pex/([^/]*)/re/([^/]*)$ /pex/index.php?p=$1&re=$2 [L]

This did not work on WAMP and generated no errors with LogLevel = debug.

Note that /pex/ is only a temporary folder, it will eventually be in the root dir.

Answers(1) :

Try to add this to your httpd.conf

<Directory "/path/to/site">
    AllowOverride All
</Directory>

In .htaccess add and this line in first line:

Options +FollowSymlinks
Comments:
2023-01-18 00:10:21
Still nothing. Options +FollowSymlinks RewriteEngine On RewriteRule ^pex/([^/]*)/re/([^/]*)$ /pex/index.php?p=$1&re=$2 [L]
2023-01-18 00:10:21
<VirtualHost *:80> DocumentRoot c:/wamp/www/ <Directory "c:/wamp/www/"> AllowOverride All </Directory> </VirtualHost> This is my httpd.conf
2023-01-18 00:10:21
I've tried both local system and server hosting many sites which have working mod_rewrite rules in .htaccess