我有一個.htaccess文件簡化htaccess的
RewriteEngine On
RewriteCond %{HTTP_HOST} ^localhost/host
RewriteRule (.*) http://localhost/host/$1 [R=301,L]
RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?seg1=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ index.php?seg1=$1
RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ index.php?seg1=$1&seg2=$2
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/$ index.php?seg1=$1&seg2=$2
RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ index.php?seg1=$1&seg2=$2&seg3=$3
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/$ index.php?seg1=$1&seg2=$2&seg3=$3
我的問題,是有這些代碼的簡化的.htaccess? 謝謝!
'[A-ZA-Z0-9 _-]'=>'?[ - \ W]' – TerryE 2012-03-04 16:41:10
你只需要每個'.htaccess'文件都有一個'RewriteEngine On'語句。 – nfechner 2012-03-04 16:57:47