0
我有一個重寫規則。.htaccess小問題
RewriteRule ^pages/(.+)$ info_pages.php?page_url=$1 [L]
這工作得很好以前。
我的網址是這樣,但在本地主機
http://dressgirls.com/demo2/pages/contact-us.html
這個指向
http://dressgirls.com/demo2/info_pages.php
當我使用這個
echo $_GET['page_url'];
它給了我。 contact-us.html/contact-us.html/contact-us.html
它應該只給一次contact-us.html
。
你知道這裏有什麼問題嗎?
這是完整的代碼
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^pages/(.+)$ info_pages.php?page_url=$1 [L]
RewriteRule ^reviews/(.+)$ edit_review.php?review_id=$1 [L]
RewriteRule ^deals/(.+)$ category.php [L]
RewriteRule ^city/(.+)$ location_deals.php [L]
#RewriteCond %{REQUEST_FILENAME} =-f
#RewriteRule ^(.*)\.php$ $1.html [NC,L]
#RewriteRule ^(.*)\.html$ $1.php [NC,L]
RewriteCond %{REQUEST_FILENAME} ^(.*)\.html$
RewriteCond %1.php -f
RewriteRule ^(.*)\.html$ $1.php [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ deal-detail-page.php [QSA,L]
</IfModule>
感謝。