文件适用于index.php?p=$1
但不适用于index.php?places=$1
RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?p=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ index.php?p=$1
RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?places=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ index.php?places=$1
从评论更新
这是我的一部分index.php
if(isset($_GET['p']) && $_GET['p']=='Kontakt'){
include ("pages/Kontakt.inc.php");
}
$događaj=(isset($_GET['događaj'])) ? $_GET['događaj'] : "none";
$mjesto=(isset($_GET['mjesto'])) ? $_GET['mjesto'] : "none";
$ponude=(isset($_GET['ponuda'])) ? $_GET['ponuda'] : "none"; elseif($ponude != "none"){
include ('pages/ponuda-template.inc.php');
} elseif($mjesto != "none"){
include ('pages/mjesta-template.inc.php');
} else $page = (isset($_GET['p'])) ? $_GET['p'] : "Početna";
include ('pages/pocetna.inc.php');