MOD改写域后,一切都变成GET [英] mod rewrite everything after domain into get

查看:192
本文介绍了MOD改写域后,一切都变成GET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么能改写域名之后一切都变成得到,如果它是不是已经得到?

例如:example.com/blah/blah.blah

将成为example.com/?blah/blah.blah

基本上所有我想要做的就是添加一个?后的第一前锋,如果心不是1已经凶多吉少。

谢谢!

解决方案

 的RewriteCond%{} REQUEST_FILENAME!-f
重写规则。* /index.php?$0 [QSA]
 

但这种方法有一些问题,@ anubhava的比较好; - )

How can I rewrite everything after the domain name into get if it is not already get?

For example : example.com/blah/blah.blah

will become example.com/?blah/blah.blah

basically all I want to do is add a ? after the first forward slash if there isnt one already.

Thanks!

解决方案

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* /index.php?$0 [QSA]

But this solution has some issues, @anubhava's is better ;-)

这篇关于MOD改写域后,一切都变成GET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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