mod_rewrite的获取查询字符串PHP [英] mod_rewrite to get query string PHP

查看:144
本文介绍了mod_rewrite的获取查询字符串PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我问一个问题,前一阵子我的目录结构梳理和大家解决我的问题(感谢!),但即时通讯现在改变这个站点到另一个服务器,并重写规则不起作用。我无法找到问题。我送打勾的主机支持,他们说:

I asked a question a while ago to sort out my directory structure and you all solved my problem (Thanks!) but im now changing this site to another server and rewrite rule does not work. I cannot find the problem. I sent a support ticked to the hosting and they said:

如果这种说法不工作那么这将是要么不正确,或没有设计,我们正在运行Web服务器的工作。我们使用Apache 2.2版本

If that statement doesnt work then it will be either incorrect, or not designed to work with the web server we are running. We use Apache version 2.2

本手册的mod_rewrite的Apache 2.2是在这里...

The manual for mod_rewrite for apache 2.2 is here...

http://httpd.apache.org/docs/2.2/mod/ mod_rewrite.html

我已经看过了本手册过来,我没有看到有什么区别我的规则!

I have looked over and over this manual and I dont see what the difference is for my rule!

我想以后 URL /银行/ 的文本,并将其发送到 URL /银行/ index.php文件一个名为参数标题!这条规则并不在我的其他服务器的空间工作,所以我知道,规则就行!

I want to get the text after the url/bank/ and send it to url/bank/index.php as a parameter called title! This rule does work on my other server space so I know that the rule does work!

规则是:

RewriteEngine on
RewriteRule ^bank/([^/.]+)/?$ bank/index.php?title=$1 [L]

任何指针将是巨大的!

Any pointers would be great!

谢谢 伊恩

推荐答案

来代替:

RewriteRule ^bank/([^/.]+)/?$ bank/index.php?title=$1 [L]

尝试:

RewriteBase /bank/
RewriteRule ^([^/.]+)/?$ index.php?title=$1 [L]

这篇关于mod_rewrite的获取查询字符串PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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