[英]Trying to get mod_rewrite rule to work
我正在嘗試使htaccess重寫規則有效,並且沒有任何運氣。 我已經完成了一些教程,可以使重定向工作,但不能重寫(這是我所需要的)。
有人可以指出正確的方向嗎?
我希望用戶輸入以下URL:
http://example.com/sample-article
實際頁面內容:
http://example.com/live-site/testing-2012/article-123/
我的htaccess規則
RewriteEngine on
RewriteRule ^/sample-article$ http://example.com/live-site/testing-2012/article-123/ [NC,L]
非常感謝您的幫助。
干杯
嘗試刪除前導/
:
RewriteEngine on
RewriteRule ^sample-article$ /live-site/testing-2012/article-123/ [NC,L]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.