开发者

URL rewrite using .htaccess

开发者 https://www.devze.com 2023-01-03 11:35 出处:网络
I need a URL like mydomain.com/myname/?action=post&data=10 Here in a single PHP page (user.php), I need all myname, post 开发者_如何转开发and 10 as GET method variables. How can I get it using

I need a URL like

mydomain.com/myname/?action=post&data=10

Here in a single PHP page (user.php), I need all myname, post 开发者_如何转开发and 10 as GET method variables. How can I get it using .htaccess?


you can add the following to .htaccess

RewriteEngine On
RewriteBase /myname/
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?$1 [L]
0

精彩评论

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

关注公众号