0
我需要建立一個301重定向我的htaccess的文件中,該問題是鏈接有特殊字符(?):創造一個htaccess的重定向包含特殊字符
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteRule ^news/news-item?blue-spares-appoints-stuart-truckel-as-sales-director?$ http://www.example.com/news [R=301,L]
RewriteRule ^news/news-item?hugely-successful-scot-plant-for-blue-scotland?$ http://www.example.com/news [R=301,L]
RewriteRule ^news/news-item?port-of-workington-takes-specialist-fuchs-materials-handler?$ http://www.example.com/news [R=301,L]
RewriteRule ^news/news-item?blue-spares-go-green-with-new-shredder?$ http://www.example.com/news [R=301,L]
RewriteRule ^used-machinery/en/shredders/used-machinery-item?000739:beast-bandit-2860?$ http://www.example.com/machinery [R=301,L]
RewriteRule ^about-us/careers/careers-item?project-manager-blue-machinery-london-ltd http://www.example.com/about [R=301,L]
RewriteRule ^news/news-item?thompsons-plant-hire-continues-allegiance-to-doppstadt-and-blue-machinery http:// http://www.example.com/news [R=301,L]
RewriteRule ^used-machinery/en/finlay/used-machinery-item?000549:798-double-deck-skin-trommel-screen http://www.example.com/machinery [R=301,L]
RewriteRule ^used-machinery/en/screeners/used-machinery-item?000549:798-double-deck-skin-trommel-screen http://www.example.com/machinery [R=301,L]
RewriteRule ^product-videos/shredders/doppstadt-ak-range/ http://www.example.com/product-videos [R=301,L]
RewriteRule ^product-videos/shredders/doppstadt-ak-range/?1 http://www.example.com/product-videos [R=301,L]
RewriteRule ^product-videos/shredders/doppstadt-ak-range/?4 http://www.example.com/product-videos [R=301,L]
RewriteRule ^product-videos/shredders/doppstadt-ak-range/?3 http://www.example.com/product-videos [R=301,L]
RewriteRule ^product-videos/shredders/doppstadt-ak-range/?7 http://www.example.com/product-videos [R=301,L]
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
什麼是最好的方式將每個這些網址重定向到正確的目的地?
我會怎樣處理這些類型的網址:used-machinery/en/finlay/used-machinery-item?000549:798-double-deck-skin-trommel-scre en –
我編輯了我的答案,我在RewriteCond中添加了「:」符號 –
您已添加'?'在一些網址之後和'$'之後,有什麼區別?他們應該只有'?' –