[英]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.