繁体   English   中英

Apache RewriteRule 不起作用 – 找不到页面

[英]Apache RewriteRule not working – page not found

我不知道为什么它不起作用,/spelling/30000 给出了 Not Found 页面。 请帮忙。

RewriteEngine On
RewriteBase /

RewriteRule ^/([0-9]+)$ /?mod=spelling&word=$1 [PT]
RewriteRule ^$ /?mod=spelling [PT]

对于您显示的示例,请尝试遵循 .htaccess 规则文件。 考虑到 index.php 文件是在后端为内部重写规则占用流量的文件。 请确保将.htaccess文件与 index.php 文件放在一起。

还要确保在测试 URL 之前清除浏览器缓存。

RewriteEngine ON
RewriteBase /

RewriteRule ^/?$ index.php?mod=spelling [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]*)/([^/]*)/?$ index.php?mod=$1&word=$2 [QSA,L]

暂无
暂无

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

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