RewriteRule in .htaccess based on language variable

I’ve a website which contains german as default language and english as alternative language. I want to redirect my rss url to another path in the website based on language condition.

I mean http://www.eample.com/rss.xml to http://www.eample.com/index.php?type=11 in default case and
http://www.eample.com/en/rss.xml to http://www.eample.com/index.php?type=11&L=1 in the case of alternative language.

I’ve tried this in the following way, but it only respect the default case.

RewriteRule rss.xml$ /index.php?type=11 [L,R=301]
RewriteRule en/rss.xml$ /index.php?type=11&L=1 [L,R=301]

Can you guys please help me to achieve this?


Source: .htaccess

1 Comment

  1. Digin Dominic

    Try this :
    RewriteRule ^rss.xml$ /index.php?type=11 [NC,L,R=301]
    RewriteRule ^en/rss.xml$ /index.php?type=11&L=1 [NC,L,R=301]

    Reply

Leave a Reply