htaccess 重写 [英] htaccess rewrite

查看:21
本文介绍了htaccess 重写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从 Web 根目录的子目录重写 url.

I am trying to rewrite a url from a sub-directory of the web root.

http://mysite.com/wiki/index.php/Main_Page

对此(注意问号):

http://mysite.com/wiki/index.php?Main_Page

我在这里做错了什么?(wiki/.htaccess)

What I'm doing wrong here? (wiki/.htaccess)

 RewriteEngine On
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^index\.php/(.*)$ ./index.php?$1 [PT,L,QSA]

推荐答案

这里的这两行已经整理好了:

These two lines here got it sorted:

RewriteEngine On
RewriteRule ^index\.php/(.*)$ index.php?title=$1 [PT,L,QSA]

这篇关于htaccess 重写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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