문제

I am trying to redirect a single URL in a .htaccess file with Redirect:

Redirect 301 /index2.php?option=com_rss&feed=RSS2.0&no_html=1 /something/somethingelse/

I have a bunch of other similar rules which work using directory structure URLs, but this one refuses to get processed.

Redirect 301 /old/url/ /new/url/

Do I have to do anything special?

Thanks!

도움이 되었습니까?

해결책

With Redirect you can only test for URL paths, or more specifically, URL path prefixes but not for the URL query. But you can do so with mod_rewrite:

RewriteEngine on
RewriteCond %{QUERY_STRING} =option=com_rss&feed=RSS2.0&no_html=1
RewriteRule ^index2\.php$ /something/somethingelse/? [L,R=301]
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top