使用两个.htaccess RewriteRules

时间:2015-06-24 15:59:59

标签: php .htaccess mod-rewrite

我想使用category.phppage.php重定向到.htaccess。在我从索引成功重定向到category.php之后,我将问题重定向到page.php

.htaccess档案:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $ !^(index\.php|images|robots\.txt\css\js)

RewriteRule ^([0-9a-zא-תA-Z_]+) category.php?name=$1 [QSA]

RewriteRule ^([0-9a-zא-תA-Z_]+)/([0-9a-zא-תA-Z_]+)/ page.php?product=$1&categ=$2 [QSA]

HTML代码(category.php):

<a href="'.str_replace(" ","_",$cval['pages_name_nice']).'/'.str_replace(" ","_",$get_one_pages['pages_name_nice']).'/"><img src="images/item_button.png" width="50" height="50" alt=""></a>

0 个答案:

没有答案