开发者

Rewriting rules with .htaccess

开发者 https://www.devze.com 2023-01-20 05:23 出处:网络
Let\'s say I have two php files in my root directory (acceable from the internet): index.php and some.php. When someone goes to my site at mydomain.net I want them to be actually accessing some.php an

Let's say I have two php files in my root directory (acceable from the internet): index.php and some.php. When someone goes to my site at mydomain.net I want them to be actually accessing some.php and any further path p开发者_开发问答resented in the url would be sent to some.php as a GET value. How would I do this with .htaccess?

mydomain.net -> some.php

mydomain.net/index.php -> some.php?value=index.php

mydomain.net/somefolder/index.php -> some.php?value=somefolder/index.php


Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)$ some.php?value=$1
0

精彩评论

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