在.htaccess中设置是这样的
# 将 RewriteEngine 模式打开
RewriteEngine On# Rewrite 定义各重写规则
RewriteRule ^([0-9]+)$ index.php/Show/index/roomnum/$1/在浏览器中输入地址http://localhost/1704013154显示404错误,打不开网页
在浏览器中输入地址http://localhost/index.php/Show/index/roomnum/1704013154却能打开,请问是怎么回事了?
# 将 RewriteEngine 模式打开
RewriteEngine On# Rewrite 定义各重写规则
RewriteRule ^([0-9]+)$ index.php/Show/index/roomnum/$1/在浏览器中输入地址http://localhost/1704013154显示404错误,打不开网页
在浏览器中输入地址http://localhost/index.php/Show/index/roomnum/1704013154却能打开,请问是怎么回事了?
贴全你的 .htaccess 文件
在哪里?没有当然不行!
RewriteEngine On
# Rewrite 定义各重写规则
RewriteRule ^([0-9]+)$ index.php?abc=$1
</IfModule>
6楼rewrite测试过是可行的。AllowOverride none 表示关闭.htaccess,如要开启可设置为AllowOverride all
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^.*(\.css|\.js|\.gif|\.png|\.jpg|\.jpeg|\.bmp)$
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
RewriteRule ^(.*)App/Tpl/(.+).html$ / [NC,F]
</IfModule>