1

I am trying to use mod_rewrite module of Apache24 server, but I am not being able to load it. I know there have been many questions asked regarding this topic and I have gone through all of them but nothing seem to work. These are the steps that I have followed until now---

  1. CHANGED httpd.conf file made these changes--

a. Uncommented LoadModule rewrite_module modules/mod_rewrite.so

b. Changed AllowOverride None to AllowOverride All

  1. Restarted apache server

  2. Checked loaded modules using command prompt command httpd -M. I can see there that the mod_rewrite module has loaded. I am attaching the image below.

The screen shot of my command prompt

But after performing all these steps I can't see mod_rewrite as loaded module in phpinfo.

Screenshot of phpinfo file

As it can be seen in the above pic there is no mod_rewrite loaded module. Also as a wild hack I even tried rewriting URLs using .htaccess file but this is not working. Apache seems to ignore .htaccess file although I have put that file inside my root directory.

 Note: I am running `PHP` as an apache module
 Using `WAMP` stack
 Using `localhost` as server

I need this module badly for URL rewriting purposes. Can you guys suggest some other way to load this module?

I am cracking my head for the past two days. Do you think a re-installation is needed or has it got something to do with path dependencies. Any suggestion will be appreciated.

EDIT

I have tried to rewrite URL from virtual host as well. But still it is not redirecting. I am adding the Virtual host setup below---

<VirtualHost *:80>
<Directory "/Apache24/htdocs">
Options FollowSymLinks 
AllowOverride All
DirectoryIndex index.html index.php
</Directory>
ServerName localhost
DocumentRoot "/Apache24/htdocs"
ErrorLog "/Apache24/logs/error.log"
CustomLog "/Apache24/logs/access.log" combined
<directory "/Apache24/htdocs">

    <IfModule rewrite_module>
            Options +FollowSymlinks
            RewriteEngine On
    </IfModule>

    <IfModule rewrite_module>
            RewriteRule   ^working.php   fun.html
    </IfModule>

</directory>
# Rewrite Rules #####################
RewriteEngine On
RewriteRule   ^working.php   fun.html
# end Rewrite Rules #################   
</VirtualHost>

The above code does not redirect it to working.php when I try to run fun.html. It simply says the requested URL /working.php was not found on this server.. Thanks in advance!

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.