开发者

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

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=开发者_如何学JAVA$3     [NC] 

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


I don't see why this shouldn't work, if everything else is correctly configured otherwise, and all the files installed. There is nothing specific in there. The explicit reference to the .co.au domain won't apply.

Just make sure you have the mod_rewrite module activated in your Apache configuration.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜