【发布时间】:2017-03-22 14:43:54
【问题描述】:
我有问题我正在使用 htaccess 添加 index.php 并转换 url。
index.php 工作正常,但 url 没有转换。
给定网址:http://example.com/allmodels/Samsung-mobiles_80
我想转换成http://example.com/allmodels?st=Samsung-mobiles_80
我使用了以下语法。
1:
Options +FollowSymLinks -MultiViews
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$1
RewriteRule ^allmodels/(.*)$ allmodels?st=$1 [NC,L]
2:
Options +FollowSymLinks -MultiViews
RewriteEngine on
RewriteRule ^allmodels/(.*)$ allmodels?st=$1 [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$1 [PT,L]
3:
Options +FollowSymLinks -MultiViews
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^allmodels/(.*)$ allmodels?st=$1 [NC]
RewriteRule .* index.php/$1 [PT,L]
我尝试了很多语法,但都对我不起作用。
找不到错误 404 页面。
【问题讨论】:
标签: php apache .htaccess mod-rewrite