Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

This is a common gripe of mine.

I was curious if there is a cheap test to know if mod_rewrite is on?

Is there a directive that i can add to the htaccess file to determine if mod_rewrite is on?

share|improve this question
1  
Do you need to see if mod_rewrite is installed on the server or if it's enabled (as in RewriteEngine is set to ON) ? –  tftd Feb 17 '12 at 22:41

2 Answers 2

up vote 4 down vote accepted
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ...
</IfModule>
share|improve this answer

I wanted to expand on the previous answer:

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteLog "/absolute/path/to/your/wwwroot/public_html/rewrite.log"
  RewriteLogLevel 5
</IfModule>

If rewrite is on it'll log any rewrites that one may have. But it should be turned off as it is expensive on the server and wouldn't be ideal for a heavy production server.

Also, i can run: httpd -t -D DUMP_MODULES to see what modules are running for apache.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.