1

I have a CentOS VPS with WHM installed.

I can't seem to configure mod_rewrite in httpd.conf. Can someone point me in the right direction?

phpinfo:

http://www.winwebsolutionz.com/blog/phpinfo.php

3
  • Which ways did you try?
    – quanta
    Commented Nov 15, 2011 at 10:36
  • opened root server..Service Configuration-Apache Configuration Within Apache Configuration please look for Include Editor When you click on Include Editor , you'll be given 3 different choices. Pre Main Include Pre Virtual Host Include Post Virtual Host Include Commented Nov 15, 2011 at 11:19
  • In your phpinfo(): the Apache httpd daemon seems to be manually compiled and the --enable-rewrite option is not there. Maybe I'm wrong... Commented Nov 15, 2011 at 18:16

2 Answers 2

2

Just Check that Apache was compiled with mod_rewrite and then enable:

Mod_Rewrite is compiled with Apache by default on cPanel. EX:

root@server [~]# sudo httpd -l | grep rewrite
  mod_rewrite.c

You can enable it for an account through the .htaccess file with a line such as:

RewriteEngine On
1

Usually cpanel(WHM) compiles mod_rewrite by default. So you must just activate it in your '.htaccess' using:

RewriteEngine On

Also I'm not sure that you can see if mod_rewrite is activated by executing phpinfo()..

7
  • opened root server..Service Configuration-Apache Configuration Within Apache Configuration please look for Include Editor When you click on Include Editor , you'll be given 3 different choices. Pre Main Include Pre Virtual Host Include Post Virtual Host Include ---The include we need to use in here is Pre Virtual Host Include . Please choose your apache version within Pre Virtual Host Include dropdown menu added this code............. RewriteEngine On Commented Nov 15, 2011 at 11:25
  • winwebsolutionz.com/blog ...i tried to configue custom permlinks in wordpress.so created .htaccess file with this code " # BEGIN WordPress RewriteEngine On <IfModule mod_rewrite.c> RewriteBase /blog/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /blog/index.php [L] </IfModule> Commented Nov 15, 2011 at 11:28
  • If you've compiled apache, you can see if it's activated in the ./compile command line; it's the option --enable-rewrite. It seems it's manually compile and the --enable-rewrite option is not there. Maybe I'm wrong... Commented Nov 15, 2011 at 18:15
  • If your mod_rewrite is not compiled in, you will get 'Internal server error' if you add 'RewriteEngine or RewriteRule' to your .htaccess. If you have some of the directives above, and you don't get any 500-Internal server error, then your mod_rewrite is COMPILED/ENABLED.
    – gryzli
    Commented Nov 15, 2011 at 22:35
  • when i added 'RewriteEngine' code to .htaccess file..getting this error..."Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request" Commented Nov 16, 2011 at 16:03

Not the answer you're looking for? Browse other questions tagged .