The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Language redirect using htaccess
salami1_1
post May 7 2007, 10:03 AM
Post #1





Group: Members
Posts: 3
Joined: 7-May 07
Member No.: 2,749



Hi all,

I've been reading some info about htaccess redirecting and I would like to check if I understand it correct.

I'm building a new site and I want to accomplish the following:
site.com/en/somefile.php -> site.com/somefile.php?lanuage=en
site.com/fr/somethingelse.html -> site.com/somethingelse.html?language=fr
etc..

I have built the following:

CODE

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.+)/(.+)\.(.+) $2\.$3\?Language=$1 [NC]


would this work? I'm not sure about the use of '$' the variables..
Also I've seen one example but that one used a lot of php code and htaccess code.. so that made me doubt if the above is possible.. just that simple, or that I am missing something.

thanks for the responses!

WBR
Steven
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post May 7 2007, 10:41 AM
Post #2


WDG Member
********

Group: Root Admin
Posts: 8,312
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



That looks right to me, but I haven't actually tried it.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
salami1_1
post May 8 2007, 03:07 AM
Post #3





Group: Members
Posts: 3
Joined: 7-May 07
Member No.: 2,749



well that is something smile.gif

I can't try it at the moment else I would have done that.. I sent it to main developer who does all the php etc .. he will put it online .. I jsut have to wait for that and see if it works

thnx
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 15th September 2019 - 09:07 PM