为网站创建htaccess

时间:2011-03-10 10:32:23

标签: php apache .htaccess mod-rewrite rewrite

2 个答案:

答案 0 :(得分:1)

答案 1 :(得分:1)

RewriteEngine On
RewriteCond %{HTTP_HOST} ^http://Yoururl/
RewriteRule (.*) http://yoururl//$1 [R=301,L]


RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)/([0-9]+)$ index.php?rayan_cat=$1&rayan_cat_in=$2
RewriteRule ^([a-zA-Z0-9_-]+)/([0-9]+)/$ index.php?rayan_cat=$1&rayan_cat_in=$2

替换您的URL并将文件保存为根文件夹中的.htaccess

现在使用GET方法可以获取参数值。