【发布时间】:2016-09-15 07:02:53
【问题描述】:
这就是我的 htaccess 文件现在的样子:
RewriteEngine On
RewriteRule ^([\sa-zA-Z0-9_-]+)$ view.php?folder=$1
RewriteRule ^([\sa-zA-Z0-9_-]+)/$ view.php?folder=$1
RewriteRule ^([\sa-zA-Z0-9_-]+)\.html$ view.php?page=$1
它接受的网址为:
http://localhost/new.html to view.php?page=new
http://localhost/something to view.php?folder=something
http://localhost/something/ to view.php?folder=something
但它不适用于以下网址:
http://localhost/something%20else
http://localhost/something%20else/
应该是view.php?folder=something%20else
【问题讨论】:
-
我没有收到任何错误,它显示的空白页面在 URL 中带有 %20。
-
不,它不起作用..
http://localhost/something%20else/正在尝试以该名称查找目录,该目录并未传递给 view.php 本身 -
一样,它写,没有
something else这样的目录 -
是的,我是说先生。
-
Not Found The requested URL /blank hiuz/ was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.Not Found The requested URL /blank hiuz/ was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.