如何用.htaccess将http://mysite.net/test/index.php/welcome/index重写为http://mysite.net/test/mainpage.html?我用下面的代码,但找不到网页的错误occours使用htaccess的url重写
RewriteEngine On
RewriteRule [mainpage]?.html$ index.php/welcome/index [L]
如何用.htaccess将http://mysite.net/test/index.php/welcome/index重写为http://mysite.net/test/mainpage.html?我用下面的代码,但找不到网页的错误occours使用htaccess的url重写
RewriteEngine On
RewriteRule [mainpage]?.html$ index.php/welcome/index [L]
你有你的订货翻转:
RewriteEngine On
RewriteBase/
RewriteRule test/index.php/welcome/index test/mainpage.html [L]
此外,[mainpage]?
的小心,因为你已经得到它指定为一个范围(即任何一个字符'm','a','i'等都会匹配),我想你的意思是匹配整个字符串。
使用以下流程: 只需点击Wamp图标。
WAMP>>
WAMP>>APACHE
WAMP>>APACHE>>httpd.conf
公开赛在notepad.Find该文件下面的代码
#LoadModule rewrite_module modules/mod_rewrite.so
通过删除#符号
LoadModule rewrite_module modules/mod_rewrite.so
那轻松改写它的代码。最后保存该文件
感谢您的回复。我试过这段代码,但仍然出现错误代码 – rohit
哪个目录是您的'.htaccess'文件?如果你的'.htaccess'在test目录下,你需要将'test /'部分从'RewriteRule'中取出,并将'RewriteBase'改为'/ test' – stevevls