0

我试过谷歌,很多教程,但在重定向一些链接时仍然存在一些问题。也许我的实际 htaccess 会产生一些冲突?

例如试过

RewriteCond %{REQUEST_URI} ^/kanaly_rss
RewriteRule rss\.php\?kat=(.*) /rss/$1 [R,L]

任何其他组合。

我想重定向链接:kanaly_rss/rss.php?kat=XXX

RSS/XXX

我的.htaccess:

选项 +FollowSymLinks +ExecCGI

<IfModule mod_rewrite.c>
 RewriteEngine On
  RewriteBase /

  RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
  RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

  # we skip all files with .something
  #RewriteCond %{REQUEST_URI} \..+$
  #RewriteCond %{REQUEST_URI} !\.html$
  #RewriteRule .* - [L]

  # redirect old links
  RewriteCond %{REQUEST_URI} !redirected_oldlink
  RewriteCond %{QUERY_STRING} co=
  RewriteRule (.*) /redirected_oldlink.php?%{QUERY_STRING} [L]

  RewriteCond %{THE_REQUEST} ^.*\/index\.php/?\ HTTP/
  RewriteRule ^(.*)index\.php/?$ "/$1" [R=301,L]

  # we check if the .html version is here (caching)
  RewriteRule ^$ index.html [QSA]
  RewriteRule ^([^.]+)$ $1.html [QSA]
  RewriteCond %{REQUEST_FILENAME} !-f

  # no, so we redirect to our front web controller
  RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
4

1 回答 1

0

尝试添加这些牵引线:

RewriteCond %{QUERY_STRING} ^(.*&)?kat=([^$]*)&?
RewriteRule ^kanaly_rss/rss.php /rss/%2? [L,R=301]
于 2012-08-16T14:25:20.247 回答