Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用.htaccess重写规则_Php_.htaccess - Fatal编程技术网

Php 使用.htaccess重写规则

Php 使用.htaccess重写规则,php,.htaccess,Php,.htaccess,假设我的根目录中有两个php文件(可从internet访问):index.php和some.php。当有人访问我的网站mydomain.net时,我希望他们实际访问some.php,url中显示的任何进一步路径都将作为GET值发送到some.php。我将如何使用.htaccess执行此操作 mydomain.net->some.php mydomain.net/index.php->some.php?value=index.php mydomain.net/somefolder/index.ph

假设我的根目录中有两个php文件(可从internet访问):index.php和some.php。当有人访问我的网站mydomain.net时,我希望他们实际访问some.php,url中显示的任何进一步路径都将作为GET值发送到some.php。我将如何使用.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