I'm trying to get an htaccess rewrite rule working and not having any luck. I've gone through a couple tutorials and can get redirects working, but not rewrite (which is what I need).
Can someone please point me in the right direction?
I want users to enter this URL:
http://example.com/sample-article
Actual page content:
http://example.com/live-site/testing-2012/article-123/
My htaccess rule
RewriteEngine on
RewriteRule ^/sample-article$ http://example.com/live-site/testing-2012/article-123/ [NC,L]
Your help is greatly appreciated.
Cheers
Try to remove the leading /
:
RewriteEngine on
RewriteRule ^sample-article$ /live-site/testing-2012/article-123/ [NC,L]
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.