views:

21

answers:

2

Hello,

If I understand correctly, I need to put something in php.ini to enable mod_rewrite.

If this is true, what do I need to put in php.ini?

Thanks in advance,

John

+4  A: 

Nope, mod_rewrite is an Apache module and has nothing to do with PHP.

To activate the module, the following line in httpd.conf needs to be active:

LoadModule rewrite_module modules/mod_rewrite.so

to see whether it is already active, try putting a .htaccess file into a web directory containing the line

RewriteEngine on

if this works without throwing a 500 internal server error, and the .htaccess file gets parsed, URL rewriting works.

Pekka
Thanks... how do I tell if the .htaccess file is getting parsed?
John
@John you usually can't activate mod_rewrite yourself on shared hosting: It's up to the hosting company to do so. Try `RewriteEngine` to see whether it maybe already is active - if it isn't, you're going to have to talk to them.
Pekka
@John re your updated comment: Write something like `asdfasdf` into the file. That should land you a `500 internal server error`.
Pekka
Yeah, okay. It is getting parsed. I still can get even a simple ReWrite to work, though.
John
@John does it accept `RewriteEngine On` without errors? If it does, the problem is with your rewrite statement. Maybe worth a new question.
Pekka
A: 

No you should not need to. mod_rewrite is an Apache module. It has nothing to do with php.ini

Jason Lewis