Forum Moderators: phranque

Message Too Old, No Replies

Friendly URLs on a Mult-lingual CMS

         

ambaxter

3:58 pm on May 18, 2011 (gmt 0)

10+ Year Member



Hey guys,

I've got a site powered by a content management system with the friendly urls option turned on.

The typical friendly URL code looks like this:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

But now, I need to insert the country code after the domain name and haven't successfully been able to merge the two directives.

The url structure I'm trying to create is:
www.domain.com/de/pagename

When I get them working individually, I reach the point where the default urls no longer work. For instance, I type the following beneath the original code
RewriteRule ^be/(.*)$ index.php?q=$1 [L,QSA]

and then the original friendly links (without country code) start returning 404s.

Thanks in advance for your help.

ambaxter

5:52 pm on May 18, 2011 (gmt 0)

10+ Year Member



We solved it!

Simply needed to put the default RewriteRule *beneath* all the others and remember to take the conditions with it.

That was where I messed up the first time.