【发布时间】:2017-08-28 09:04:32
【问题描述】:
来自带有模式的 URL-
http://example.com/top-100-selenium-interview-questions-answers.html?format=pdf
我想重定向到
http://example.com/istqb_dump.pdf
我已经按照规则创建了重定向。
RewriteCond %{QUERY_STRING} format=pdf [NC]
RewriteRule .* http:// example.com/istqb_dump.pdf? [R=301,L]
一切正常。
现在还有其他 URL 如下所示 -
http://example.com/top-35-seo-interview-questions/?format=pdf
http://examplecom/top-15-digital-marketing-interview-questions/?format=pdf
我想重定向到相应的 URL 直播
http://example.com/seo.pdf
http://example.com/digital-marketing.pdf
但是按照上面的规则,所有的 URL 都会重定向到
http://example.com/istqb_dump.pdf
如何配置独立重定向?
【问题讨论】:
-
更具体地说明您让 RewriteRule 匹配的内容...?
-
我想从 url - example.com/… 重定向到这个 url example.com/istqb_dump.pdf 请告诉我 .htaccess 规则。
标签: .htaccess redirect mod-rewrite url-redirection