繁体   English   中英

PHP中的Htaccess重写模式无法与此代码一起使用

[英]Htaccess Rewrite mode in php not working with this code

我的第一个网址是:

http://localhost/get.php?lang=fa&action=news&news=218

我想要这个:

http://localhost/fa/news/218

我使用以下代码:

RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)/([^/]*)$ /get.php?lang=$1&action=$2&news=$3 [L]

但这不起作用。 (404页)

问题是什么 ?

我已经在本地环境中测试了以下内容:

RewriteEngine On
RewriteRule ^([^/]*)/?([^/]*)/?([^/]*)/?$ get.php?lang=$1&action=$2&news=$3

结果是:get.php?lang = fa&action = news&news = 218

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM