需要有关litespeed web服务器.htaccess规则的帮助。
http://example.com/temp/home.php是现有的URL,但现在我们需要重写的内容如下:
http://example.com/temp.php?redirect=home.php下面还给出了我们现有的.htaccess代码。
RewriteEngine on<br/>
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^temp/(.*)$ temp.php?redirect=$1 [QSA,L]但是我不知道问题是什么,这个重写仍然不能工作,并显示404错误,因为temp/home.php不存在。
这些规则适用于Apache服务器,但不适用于Litespeed
参考:https://htaccess.madewithlove.be?share=d15d3bca-6974-5682-902a-823c1a63e2b7
提前谢谢。
发布于 2019-01-14 04:14:03
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^temp/(.*)$ temp.php?redirect=$1 [QSA,L]上面的代码将服务于temp.php?redirect=home.php的内容。
作为测试,我在一个域的根目录下创建了temp.php,内容如下:
<?php
var_dump($_GET);访问/temp/home.php时的结果是:
array(1) {
["redirect"]=>
string(8) "home.php"
}这在LiteSpeed网络服务器5.3.4和5.3.5上进行了测试。
https://stackoverflow.com/questions/54172657
复制相似问题