How should i change the root for mod_rewrite url when i work in localhost

Posted by Rajasekar on Stack Overflow See other posts from Stack Overflow or by Rajasekar
Published on 2010-03-29T16:50:44Z Indexed on 2010/03/29 16:53 UTC
Read the original article Hit count: 416

Filed under:
|
|
|

I am working on a site maintainence. It uses mod_rewrite technique. But im new to mod_rewrite. How should i change the url to work correctly in my localhost. here's the code:

# Enable mod_rewrite, start rewrite engine 
Options +FollowSymLinks 
RewriteEngine on 

rewritecond %{http_host} ^electricians4u.com.au [nc]
rewriterule ^(.*)$ http://www.electricians4u.com.au/$1 [r=301,nc]

ErrorDocument 404 /error404.php

# for searching
RewriteRule ^([^/]*)-in-([^/]*)\.htm$   /search.php?searchby=$1&SearchString=$2&search.x=$3&search.y=$4&search=Find+Agent [NC] 

# for nav
RewriteRule ^electricians-in-([^/]*)-([^/]*)$ /search.php?SearchString=$1&state=&page=$2          [NC] 

# index page
RewriteRule ^find-electrician-(.*)$ /find_electrician_in.php?state=$1                    [NC,L] 

# find  page
RewriteRule ^electrician-(.*)-(.*)$ /find_electrician_in.php?state=$1&bspname=$2         [NC,L] 

# find  page
RewriteRule ^electricians-in-([^/]*)\.htm$ /search.php?state=$1&bspname=$2&locality=$3     [NC] 

Plz help. I know this silly question to ask. But i dont know other alternative.

© Stack Overflow or respective owner

Related posts about mod-rewrite

Related posts about php