shane
shane

Reputation: 177

phpinfo() mod_rewrite

I'm attempting to perform some url rewriting, and after looking at the phpinfo file, I can't see any mention of this.. My host is FastHosts.

Should I be looking for something else in the phpinfo() or should I assume that mod_rewrite is simply disabled?

Upvotes: 8

Views: 34222

Answers (4)

bartek_zet
bartek_zet

Reputation: 309

This works on Debian:

apache2ctl -t -D DUMP_MODULES

Upvotes: 1

Mohd Abdul Mujib
Mohd Abdul Mujib

Reputation: 13948

I had followed all the procedures to enable the mod rewrite. But it just didn't seem to work.

I had even added the floowing piece of code correctly to the .conf file but to no avail.

<Directory “/var/www/html”>
AllowOverride All
</Directory>

But then I noticed, Those inverted commas don't look normal!!! Bam!! Replaced those peskies with correct ones and Wah-Lah!!!

Upvotes: 0

C.O.
C.O.

Reputation: 2329

When PHP gets used as an Apache module apache_get_modules() can be used to check this

<?php
print_r(apache_get_modules());
?>

which then gives a result like this:

Array
(
   [0] => core
   [1] => http_core
   [2] => mod_so
   [3] => sapi_apache2
   [4] => mod_mime
   [5] => mod_rewrite
)

apache_get_modules() does not work if you are using PHP as CGI

Upvotes: 8

Emil H
Emil H

Reputation: 40230

mod_rewrite is an apache module, not a PHP module. It isn't visible in phpinfo(). Create an .htaccess in some subfolder and make sure it contains:

RewriteEngine on

Point your browser to the folder. If you get a Server Error, it isn't installed. Otherwise it is.

Upvotes: 11

Related Questions