Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/247.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 使用wamp服务器在本地主机上重写htaccess错误_Php_.htaccess_Url Rewriting_Wamp - Fatal编程技术网

Php 使用wamp服务器在本地主机上重写htaccess错误

Php 使用wamp服务器在本地主机上重写htaccess错误,php,.htaccess,url-rewriting,wamp,Php,.htaccess,Url Rewriting,Wamp,我试图为本地服务器重写htaccess 这是我的本地URL 我需要类似于此页面的内容: 我试过了,但不起作用。将您的htaccess文件更改为: Options +FollowSymLinks RewriteEngine on RewriteCond %{THE_REQUEST} ^(GET|POST)\ /index\.php\?var=(.*)\ HTTP RewriteRule ^ /index/%2\? [R=302,L] RewriteRule ^index/(.*)$ /ind

我试图为本地服务器重写
htaccess

这是我的本地URL

我需要类似于此页面的内容:


我试过了,但不起作用。

将您的htaccess文件更改为:

Options +FollowSymLinks 
RewriteEngine on 
RewriteCond %{THE_REQUEST} ^(GET|POST)\ /index\.php\?var=(.*)\ HTTP
RewriteRule ^ /index/%2\? [R=302,L]

RewriteRule ^index/(.*)$ /index.php?var=$1 [L]

以上内容应更改
http://kiwitravel.localhost/index.php?var=home
http://kiwitravel.localhost/index/home

您使用的是框架吗?您可以发布htaccess文件的内容吗?你说它不起作用。会发生什么?它是否给出了500个错误?不,我没有使用框架。选项+FollowSymLinks RewriteEngine on RewriteRule/var/(.*)/index.php?var=$1这是htacces.showign 5oo错误您的htaccess文件中还有什么其他内容吗?在url栏中,它是显示旧url(
index.php?var=value
)还是显示新url(
index/value
)仍然像index.php?var=value一样,您的htaccess文件中只有上述代码,并且该文件与index.php是?ya..htaccess和index file是同一文件夹。