开发者

Use ? at end of url without the need for pagename.ext

On my website I pass parameters like this:

http://www.mysite.com/somepage.php?action=something

But I would like do just do this:

http://mysite.com/?action=something

How can I do this? Do you know of any good, simple resources around? I can't find any because I don't know exactly what 开发者_如何学Goto look for.

Lots of thanks in advance!

jase


The URL you show will usually go to the index file in the root directory (e.g. index.php).

You will be able to catch $_GET["action"] from there without any additional work.


.htaccess

RewriteEngine On
RewriteRule ^([^/]*)$ /somepage.php?action=$1 [L]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜