working for rewrite rules for my website couples of days now but failed to do it successfully.
googled a lot and also found some very important threads here in stackoverflow,specially this one. I have made all the changes which are mentioned in the web.Before i talk about the changes i made to my httpd.conf
, i want share the directory structure of my wamp
root directory for my website is C:/wamp/www/dist
. index.php
and .htaccess
files for my website are kept Within this dist folder and there are other sub-directories for other files for my website.
MY CHANGES ::
wamp --> Apache --> Apache modules --> rewrite_module
checked it
----------------IN MY APACHE httpd.conf file----------------
LoadModule rewrite_module modules/mod_rewrite.so //removed # sign from it
<Directory />
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory "c:/wamp/www/">
Options Indexes FollowSymLinks
AllowOverride all
Order Allow,Deny
Allow from all
</Directory>
<Directory "c:/wamp/www/dist/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
</Directory>
and now i have created a .htaccess
file in my C:/wamp/www/dist
(index.php is also here)
so my .htaccess
looks like
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /dist/
RewriteRule ^([^/]*)\.html$ /dist/?path=$1
</IfModule>
Result/Error :: It is not working url remains the same(ugly) as before.no changes in url.
Error Explained :: from my any pages which are in other sub-directories i send a request to my index.php which looks like http://localhost/dist/?path=home
and after checking the value of path variable index.php
includes necessary file.so I want to my url as http://localhost/dist/home
.but as i said it is not working.my url still remains
http://localhost/dist/?path=home
after creating .htaccess
file
Note 1 :: i checked phpinfo()
the modules are loaded.
Note 2 :: I tried by removing <IfModule mod_rewrite.c>
from .htaccess
but it has no effect all are same again