$ _GET [ "category"]를 사용하여 데이터베이스에서 올바른 내용을 가져 오는 category.php5라는 페이지가 있습니다. 내가 원하는 꽤 그것을 너무 외모와 같은 :.htaccess mod_rewrite 문제 - 발에 몸을 발로 차 넣었습니까?
sinaesthesia.co.uk/category/psoriasis
같을 것이다 :
sinaesthesia.co.uk/category.php5?category=psoriasis을
필자는 이전에 이런 종류의 재 작성을 성공적으로 마쳤지 만, 지금은 제대로 작동하지 않기 때문에 규칙이있어 걱정 스럽습니다. 여기 내 전체 htaccess로 파일입니다 - 라인의 마지막 커플은 위의 재 작성을 해야하는 : 나는 수동 category.php5/카테고리 = 건선을 입력하면
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]
#Translate /category/psoriasis to /category.php5?category=$1
RewriteRule ^category/(.*) /category.php5?category=$1 [L]
, 그것은 잘 작동합니다. Category.php5/category/psoriasis를 입력 할 때 카테고리가 없습니다. 나는 내 라인이 html/html로 바뀌는 것에 대해 걱정하고있다. 오류입니다, 그러나 제가 그 라인을 꺼내더라도 여전히 작동하지 않습니다. 다른 모든 것은 예상대로 작동합니다.
해당 URL의 요청에 해당 규칙이 적용되지 않습니까? – Gumbo
내가 알지는 못한다 - 나는 곧은 404 상태가된다. – user97410