我想使用。htaccess重定向頁面URL [R = 301]重定向URL使用。htaccess [R = 301,L]
原始地址:http://www.encros.fr/la-boutique-encros/recharge-toner
重定向URL:http://www.encros.fr/recharge-toner
任何人可以幫我 ?
我想使用。htaccess重定向頁面URL [R = 301]重定向URL使用。htaccess [R = 301,L]
原始地址:http://www.encros.fr/la-boutique-encros/recharge-toner
重定向URL:http://www.encros.fr/recharge-toner
任何人可以幫我 ?
試試這個
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^recharge-toner$ /la-boutique-encros/recharge-toner [L]
它不工作,它會給404錯誤。 @sumit – 2013-03-28 11:02:48
我已經更新了代碼,現在試試 – 2013-03-28 11:06:34
.htaccess中[R = 301]的實際使用是什麼? @sumit – 2013-03-28 11:13:56
你需要像這樣在你的.htaccess文件:
RewriteEngine on
RewriteRule ^/la-boutique-encros/recharge-toner$ /recharge-toner [R=301,L]
的[R=301]
標誌設置返回代碼。 [L]
標誌防止將其他規則應用於此特定重寫。
參考文獻:
關於改寫:http://httpd.apache.org/docs/2.4/rewrite/remapping.html
如果您在Apache上運行,查找國防部重寫 – 2013-03-28 10:55:21
是的,我工作的Apache,但我不」 t知道如何url重定向使用.htaccess @MarcAudet – 2013-03-28 10:57:24