.htaccess 重命名url不适用于htaccess
我正在使用以下重写规则重命名url:-.htaccess 重命名url不适用于htaccess,.htaccess,url,url-rewriting,.htaccess,Url,Url Rewriting,我正在使用以下重写规则重命名url:- RewriteRule^home$index.php 但这是行不通的。所以我使用了另一条规则,即 RewriteRule^home.html$index.php 它显示的是404错误 注意:相同的代码在其他站点工作,但在我的站点中不工作。 Thanx 在您的规则之前,确保打开mod_rewrite: RewriteEngine on RewriteBase / RewriteRule ^home(\.html?)?$ index.php [NC,L]
RewriteRule^home$index.php
但这是行不通的。所以我使用了另一条规则,即
RewriteRule^home.html$index.php
它显示的是404错误
注意:相同的代码在其他站点工作,但在我的站点中不工作。
Thanx 在您的规则之前,确保打开
mod_rewrite
:
RewriteEngine on
RewriteBase /
RewriteRule ^home(\.html?)?$ index.php [NC,L]
这将把/home
、/home.htm
和/home.html
重写为index.php
。如果这不起作用,请检查httpd.conf
文件中是否启用了mod#u rewrite
:(删除#之前)
将
AllowOverride None
更改为AllowOverride All
无处不在。重新启动Apache。是否启用了mod_重写?这是你的完全访问权限吗?不,我不知道,请告诉我你在哪里访问它,它在线,我不知道在哪里访问cpanel,服务器在哪里apache@SumeetMathew如果您希望得到任何帮助,我建议您使用普通英语交谈,而不要使用TXT语言。另外:请用谷歌搜索如何找出是否启用了mod_rewrite。
LoadModule rewrite_module modules/mod_rewrite.so