0
我在我的.htaccess文件的幾個重寫規則,所有做工精細,我想添加一個特定的情況下,把仍然有mod_rewrite的問題/的.htaccess
sinaesthesia.co.uk/category/psoriasis
到
sinaesthesia.co.uk/category.php5?category=psoriasis
所以,我想:
重寫規則^ CA()。 tegory /(。)$ /$1category.php5?category=$2 [L]
這是行不通的。我試過它沒有捕獲'category'之前的東西,因爲category.php5在根目錄無論如何,所以它應該沒有這個工作,已經嘗試:
RewriteRule^category /([az] +?)$ /category.php5?category=$1 [L]
有和沒有捕獲類別之前的東西,沒有什麼作品 - 事實上,我通常會得到500錯誤!下面是該文件的其餘部分:
RewriteEngine On
#remember to change this to aromaclear
RewriteCond %{HTTP_HOST} !^sinaesthesia\.co.uk$ [NC]
RewriteRule ^(.*)$ http://sinaesthesia.co.uk/$1 [R=301,L]
#Translate default page to root
RewriteCond %{THE_REQUEST} ^GET\ .*/index\.(php5|html)\ HTTP
RewriteRule ^(.*)index\.(php5|html)$ /$1 [R=301,L]
#translate any .html ending into .php5
RewriteRule ^(.*)\.html$ /$1\.php5
#change/for ?
RewriteRule ^(.*)\.html/(.*)$ /$1\.html?$2
#strip .html from search res page
RewriteRule ^(.*)search/(.*)$ /$1search_results\.html/search=$2
#translate product details link from search res page
RewriteRule ^products/(.*)/(.*)/(.*)$ /product_details.php5?category=$1&title=$2&id=$3 [L]
#Translate products/psorisis/chamomile-skin-cream-P[x] to productview.php5?id=1
RewriteRule ^products/.*-P([0-9]+) /productview.php5?id=$1 [L]