我想我这儿有个不错的。
试图在.htaccess文件中写入重写程序。
如果传入的URL中包含?p=,则需要重写index.php。如果传入的域名仅为www.myurl.com,我需要它重写到home.php。
这有可能吗?
谢谢。
发布于 2016-02-13 11:06:36
试着:
RewriteEngine on
#--If the incoming url has "?p="--#
RewriteCond %{QUERY_STRING} p=.* [NC]
#--Then redirect to /index.php--#
RewriteRule ^ /index.php? [NC,L,R]
#--Else, redirect to home.php--#
RewriteRule ^$ /home.php [NC,L,R]https://stackoverflow.com/questions/35364668
复制相似问题