开发者

htaccess rewrite query on homepage URL problem

开发者 https://www.devze.com 2023-03-28 01:09 出处:网络
I want to make a RewriteRule rule so when someone goes to the base index of my site eg: example.com/ I want this to happen:

I want to make a RewriteRule rule so when someone goes to the base index of my site eg:

example.com/

I want this to happen:

Rew开发者_开发问答riteBase /
RewriteRule ^/ /index.php?pageID=1

So when someone goes to the homepage; a query for pageID=1 is sent.

However the above code doesn't work, going to the homepage with the above code doesn't get the query sent. (other rewrite rules are working correctly)

Any help would be appreciated. Thanks.


Remember RewriteRule has no / at the beginning of it!

RewriteRule ^$ index.php?pageID=1


RewriteCond %{REQUEST_URI} ^/?$
RewriteRule ^(.*)$ /index.php?pageID=1
0

精彩评论

暂无评论...
验证码 换一张
取 消