搜索引擎友好的URL不能正常工作使用的.htaccess [英] SEO friendly URL not working using .htaccess

查看:134
本文介绍了搜索引擎友好的URL不能正常工作使用的.htaccess的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实现使用的.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

这篇关于搜索引擎友好的URL不能正常工作使用的.htaccess的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆