0
嗨,大家好,我非常感謝你,因爲我從這裏得到了幾個解決方案,就像我希望我能爲我當前的問題獲得解決方案。如何在.htaccess中重寫URL
URL是這樣
www.xyz.com/c73-Graphic-Desgin?resultpage=2&aid=1
在URL 「73」 「2」 「1」 是值
我試圖重寫它像下面.htaccess文件
,但它不會工作...
RewriteEngine On
RewriteRule ^c(.+)-(.+)-(.+)?resultpage=(.+)&aid=(.+)/?$ template.php?cid=$1&resultpage=$4&aid=$5&search=yes
請幫我解決這個問題,在此先感謝...
我.htacces s文件
RewriteEngine On
#RewriteRule ^article/(.*)?$ article.php?aid=$1
#RewriteRule ^knowledge_base/([0-9]+)/(.*)?$ knowledge_base.php?p=$1&cid=$2
RewriteRule ^(.*)-article?$ article_detail.php?artid=$1
RewriteRule ^t([0-9]+)-(.+)/?$ temlate_detail.php?tid=$1
RewriteRule ^c([0-9]+)-sc([0-9]+)-(.+)/?$ templates.php?cid=$1&&scid=$2
RewriteRule ^c([0-9]{1,2})[a-zA-Z-]+?resultPage=([0-9]+)&aid=([0-9]+)$ templates.php?cid=$1
RewriteRule ^ac([0-9]+)-(.+)/?$ articles.php?cid=$1
RewriteRule ^p-(.*)$ pages.php?pageid=$1
#For PHP files:
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^(index|about|faq|freelancers|articles|contact|affiliates|login|forgot_password|change_password|cart|order_view|checkout|checkout_response|success|downloads|order_detail)(/.*)?$ $1.php
#php_value display_errors Off
#php_value upload_max_filesize 2000M
#php_value post_max_size 2000M
Options All -Indexes
感謝您的快速回復.. 我試圖這樣 重寫規則^ C([0-9] {1,2})[A-ZA-Z - ] + resultPage =([0 -9] +)&aid =([0-9] +)$ templates.php?cid = $ 5 但它也給錯誤:( – rkaartikeyan
什麼是錯誤? –
https://www.magiktemplates.com/c73 -Graphic-Desgin?resultpage = 2&aid = 1 看到鏈接...其給出的錯誤..先生 – rkaartikeyan