首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >通过htaccess写入Url

通过htaccess写入Url
EN

Stack Overflow用户
提问于 2012-09-13 19:37:08
回答 1查看 92关注 0票数 0

我在本地主机中工作,已经在我的站点中编写了htaccess

真实URL:

代码语言:javascript
复制
localhost/lite-cms/template/content/index.php?u_title=about-mind-yolk

我添加的htaccess

代码语言:javascript
复制
RewriteRule ^([^/]*)\.html$ /lite-cms/template/content/index.php?id=$1 [L]

我像这样获取URL

代码语言:javascript
复制
http://localhost/lite-cms/template/content/about-mind-yolk.html

但是我想要这样的URL,没有show template/content/

代码语言:javascript
复制
http://localhost/lite-cms/about-mind-yolk.html

请给出一个解决方案?

EN

回答 1

Stack Overflow用户

发布于 2012-09-13 20:24:12

尝试一下(确保htaccess位于lite-cms/目录中):

代码语言:javascript
复制
RewriteEngine on
RewriteBase /lite-cms/
RewriteRule ^([^/]*)\.html$ template/content/index.php?u_title=$1 [L]
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12405361

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档