【发布时间】:2015-10-13 17:03:02
【问题描述】:
所以我想创建一个带有隐藏变量的 URL Friendly,看起来像这样:
website.dev/en/page/detail.html(工作,展示内容)
.htaccess 文件
Options +FollowSymLinks -MultiViews
RewriteEngine on
RewriteBase /
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/(.*)$ index.php?lang=$1&page=$2&detail=$3 [L,QSA,NC]
RewriteRule ^([^/]+)/([^/]+)/(.*)$ index.php?lang=$1&page=$2 [L,QSA,NC]
RewriteRule ^([^/]+)/(.*)$ index.php?lang=$1 [L,QSA,NC]
php 文件:
$_GET['lang']); // en
$_GET['page']); // page
$_GET['detail']); // detail.html
所以,页面返回错误状态 500,但显示内容
http://i.stack.imgur.com/Qgv5m.png
我该如何解决这个问题?
【问题讨论】:
标签: php regex apache .htaccess mod-rewrite