Forum: 

cant get mod_rewrite working!!

Jeremy Selph's picture

All I am trying to do is get mod_rewrite to work on turnkey linux and so far having no luck.

  1. I went to the webmin under apache > configure apache modules > I checked rewrite and saved ( I looked to see if it was and is )
  2. I check my phpinfo file and under Loaded Modules. It is there.
  3. Uploaded a new .htaccess file to my directory /var/www/projects/jsnew/.htaccess
The contents of the htaccess are:
RewriteEngine on
RewriteRule ^index.php$ about_us.php

I should be seing about_us page with inde.php url and I am not.

Is there anything else I need to do from with in webmin?

Neil Aggarwal's picture

I think your RewriteRule has to start with a slash:

RewriteRule ^/index.php$ /about_us.php

Try that and see if it helps.

Jeremy Selph's picture

nah I tried that and still doesnt work. There has to be something else here that isn't allowing mod_rewrite to work. Are there any other config files?

Neil Aggarwal's picture

I just followed your steps on a LAMP appliance and the rewrite is working.

This url:

http://38.114.205.10/test/index.php

Gives me the content of the about.php page.

I followed the exact same steps you stated above:

1. Enabled the rewrite module in Webmin
2. Created an .htaccess file with this content:

RewriteEngine on
RewriteRule index.php about.php

I don't know what to say.

Jeremy Selph's picture

what build or turnkey are you using?

Neil Aggarwal's picture

I am using the LAMP appliance from here:

http://www.turnkeylinux.org/lamp

So, it is 2009.10

I installed it from the ISO file.

Did you get my message with the login info to my appliance so you can try it?

Post new comment