2012-08-16 122 views
0

我試過谷歌,許多教程,但仍有重定向一些鏈接的一些問題。也許我的實際htaccess產生一些衝突?htaccess重定向鏈接

嘗試例如

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

任何其他一些組合。

我想重定向鏈接: kanaly_rss/rss.php吉= 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> 

回答

0

嘗試添加這些拖曳線:

RewriteCond %{QUERY_STRING} ^(.*&)?kat=([^$]*)&? 
RewriteRule ^kanaly_rss/rss.php /rss/%2? [L,R=301] 
+0

我獲得/ RSS /?吉= X – user1410263 2012-08-16 14:40:56

+0

是我的錯,我編輯的答案 – Oussama 2012-08-16 14:46:01

+0

另一個小編輯和它的作品。 RewriteCond%{QUERY_STRING} ^(。*&)?kat =(。*)&? RewriteRule^kanaly_rss/rss.php/rss /%2? [L,R = 301] 謝謝! – user1410263 2012-08-16 14:52:26