2010-12-17 119 views

回答

0

沒有測試過,但我想你會希望以下內容:

RewriteRule ^/subfolder/controller/(method/.*)$ /subfolder/index.php?controller/$1 
0

你可以在你的httpd.conf文件中試試這個:

#start your engine 
RewriteEngine on 
#add www. for any url, not what you asked for, but kinda helpful SEO-wise 
RewriteCond %{HTTP_HOST} ^mypage\.com 
RewriteRule ^(.*)$ http://www.mypage.com$1 
#rewrite stuff 
RewriteRule ^/subfolder/(controller/method/arg1)/?$ /index.php?$1 

這應該有效。我會改變最後一行,tho:

RewriteRule ^/subfolder/(controller/method/arg1)/?$ /index.php?p=$1 

現在,在重新啓動apache之前,嘗試測試配置文件是否正常。

user$ apachectl configtest 

就是這樣。

希望它有幫助。

乾杯

0
RewriteRule ^products/([0-9][0-9])/$ /productinfo.php?prodID=$1 [R] 
RewriteRule ^products/([0-9][0-9])$ /products/$1/ 

在同.htaccess文件多次重定向可以按順序,這是什麼這樣做可以應用