Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.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
.htaccess 本地主机上的htaccess重写规则_.htaccess_Localhost_Url Parameters - Fatal编程技术网

.htaccess 本地主机上的htaccess重写规则

.htaccess 本地主机上的htaccess重写规则,.htaccess,localhost,url-parameters,.htaccess,Localhost,Url Parameters,我试图在我的本地主机上用URL中的4个参数做一个快速演示,并用echo$_GET['param2']等显示它们。我有一个为Apache工作的重写引擎,并且没有记录任何错误。页面已显示,但我的$\u GET得到了未定义的索引 第一个参数将是我要访问的页面。2-4个参数将只是变量 网址: htaccess: Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d Rewr

我试图在我的本地主机上用URL中的4个参数做一个快速演示,并用echo$_GET['param2']等显示它们。我有一个为Apache工作的重写引擎,并且没有记录任何错误。页面已显示,但我的$\u GET得到了未定义的索引

第一个参数将是我要访问的页面。2-4个参数将只是变量

网址:

htaccess:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/([^/]+)/([^/]+)$ $1.php?param1=$2&param2=$3&param3=$4 [B,QSA,L]
index.php:

echo $_GET['param2'] . ' 1<br>';

我做错了什么?同一个htaccess文件在我的办公室工作。

忘记了regexp^[^/]+/[^/]+/[^/]+/[^/]+/[^/]+$谢谢-但它仍然不工作。我得到$\u GET['param1']是一个未定义的索引。