由网友(不羁绊的感情)分享简介:我想实现使用的.htaccess通过以下I'm trying to implement a SEO friendly URL using .htaccess by using the RewriteRule belowRewriteRule ^n/article/([a-zA-Z0-9]+)/$ article.p...
我想实现使用的.htaccess通过以下
I'm trying to implement a SEO friendly URL using .htaccess by using the RewriteRule below
RewriteRule ^n/article/([a-zA-Z0-9]+)/$ article.php?title=$1
在actaul URL看起来像这样
The actaul URL looks like this
http://localhost/n/article.php?title=this-is-the-first-news-article
但我希望它看起来是这样的:
but I want it to look like this :
http://localohst/n/article/this-is-the-first-news-article
当我把它应用上面的RewiteRule不会更改为所需的URL
When I applied the RewiteRule above it does not change to the desired URL
推荐答案
这应该这样做。你缺少n个。不知道为什么,虽然所需要的单词称号。
This should do it. You are missing the n. Not sure why you need the word title though.
RewriteRule ^n/article/title/([a-zA-Z0-9]+)/$ article.php?title=$1
相关推荐
最新文章