htaccess的重写 [英] htaccess rewrite

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

问题描述

我想从Web根目录的子目录重写的URL。

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

本(注问号):

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

我在做什么错在这里? (维基/的.htaccess)

  RewriteEngine叙述上
 的RewriteCond%{} REQUEST_FILENAME!-f
 的RewriteCond%{} REQUEST_FILENAME!-d
 重写规则^指数\ .PHP /(.*)$ ./index.php?$1 [PT,L,QSA]
 

解决方案

下面这两行得到它排序:

  RewriteEngine叙述上
重写规则^指数\ .PHP /(.*)$的index.php?标题= $ 1 [PT,L,QSA]
 

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

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

to this (note question mark):

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

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天全站免登陆