简单的.htaccess重写以传递1个参数 [英] Simple .htaccess rewrite to pass 1 parameter
本文介绍了简单的.htaccess重写以传递1个参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人可以告诉我我的.htaccess文件应包含哪些内容以创建以下重写:
Can someone please tell me what should my .htaccess file contain to create the following rewrite:
http://www.example.com/success
打电话
http://www.example.com/index.php?q=success
推荐答案
尝试使用:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ /index.php?q=$1 [L]
这篇关于简单的.htaccess重写以传递1个参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文