htaccess Elite

Hire htaccesselite professional

.htaccess tutorial


All times are UTC - 5 hours





Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: rewrite virtual folder into subdomain
PostPosted: Apr 14th, '08, 12:48 

Joined: Apr 14th, '08, 11:28
Posts: 5
hello all

first off, im a total looser with mod_rewrite
due to a client request, im looking at the following setup:

a joomla installation using 2 third party addons, one to add multilanguage capabilties (say for english, french and spanish)
and another to rewrite the joomla standart urls to pURLs. so far so good.

now, the setup produces nicely working sef URLS organizing the languages as virtual folders, as in:
domain.com/french etc.

the client, however, insists in having the languages distributed over subdomains instead of folders, as in:
spanish.domain.com etc.

none of the code which rewrites the standrt urls into pURLs is within the htaccess file.



the task, thus, seems to present itself as such:
rewrite the language folders pURLs -which themselves, mind you, are already rewritten from the standart CMS URLs, into
subdomain pURLs, while keeping the whole thing working .....

id be grateful if somone could confirm whether this is this actually possible (i have some doubts about this)
and what a step by step approach may look like.

technically, google and users with their browsers must see french.domain.com.
hence, i assume, the requests resulting from people clicking on links need first be internally adressed to domain.com/french, and then the served page need to be again rewritten to french.domain.com.

in addition, people attempting to access domain.com/french directly need to be redirected to french.domain.com permanently, which -me thinks- is where the cat may be biting its own tail.

hope someone can shed seme light on this mess...
thanks in advance for all efforts

best regards :)
dee


Top
 Profile  
 
 Post subject: Re: rewrite virtual folder into subdomain
PostPosted: Apr 28th, '08, 11:41 

Joined: Apr 14th, '08, 11:28
Posts: 5
hi again

id be pretty happy already if someone could point out to me whether the above idea is technically conceivable, somehow,
or just nonsense ... :)

best
dee


Top
 Profile  
 
 Post subject: Re: rewrite virtual folder into subdomain
PostPosted: May 9th, '08, 16:57 

Joined: Oct 30th, '06, 13:55
Posts: 89
Yes its definately possible, kinda cool actually!

First off, can you modify the joomla or whatever is outputting html so that the links are all printed as spanish.domain.com instead of domain.com/spanish/? If so then the solution is easy.


Top
 Profile  
 
 Post subject: Re: rewrite virtual folder into subdomain
PostPosted: May 9th, '08, 22:57 

Joined: Apr 14th, '08, 11:28
Posts: 5
hi
thanx for the reply... :)

theoretically yes, at the expense of hacking the extension that does the rewiriting, which
a) isn't too easy, according to the developper, and
b) undesireable, as each important update of the extension had to be hacked again & again...

the attractivity idea of 're-rewriting' the extensions output instead of touching the extension is what started all of this. :)
the point of departure is thus domain.com/spanish, unfortunately.
is that kind of re-rewriting, or whatever one may call it, possible ?

regards
dee


Top
 Profile  
 
 Post subject: Re: rewrite virtual folder into subdomain
PostPosted: May 10th, '08, 22:04 

Joined: Oct 30th, '06, 13:55
Posts: 89
Heres what I'm saying.. Of course it is possible using mod_rewrite or mod_alias to redirect all client requests for domain.com/spanish to spanish.domain.com That is pretty easy. The part that you need to think about is linking to spanish.domain.com instead of domain.com/spanish

IOW, will your html output (even on spanish.domain.com) still link to domain.com/spanish? Thats not good. It will still work because when they click on domain.com/spanish they will be redirected to spanish.domain.com but that means ALL requests for ALL non-english urls will be 301 redirected, which is just crazy and will fill up your logs like crazy.

Take this forum, a url for viewforum.php?forum=12 is the real url, but we have hacked phpBB so that the output throughout the site is mod-rewrite-vf12.html

Thats what I am saying, so hacking joomla is neccessary if you really want to do it right.


Top
 Profile  
 
 Post subject: Re: rewrite virtual folder into subdomain
PostPosted: May 12th, '08, 19:19 

Joined: Apr 14th, '08, 11:28
Posts: 5
Quote:
Will your html output (even on spanish.domain.com) still link to domain.com/spanish? Thats not good.

yup, i had played around with the redirection part, and the pages that are being served link to domain.com/spanish

Quote:
when they click on domain.com/spanish they will be redirected to spanish.domain.com but that means ALL requests for ALL non-english urls will be 301 redirected, which is just crazy


hm, im getting it...
that wouldnt be too SEO either, would it ?

Quote:
hacking joomla is neccessary if you really want to do it right.

ok.
hacking the add-on in this case,
which gets me back to square 1...

just so i could test around some, what would the code look like ?

rgds
dee


Top
 Profile  
 
 Post subject: Re: rewrite virtual folder into subdomain
PostPosted: May 14th, '08, 23:05 

Joined: Oct 30th, '06, 13:55
Posts: 89
The code to do what exactly?


Top
 Profile  
 
 Post subject: Re: rewrite virtual folder into subdomain
PostPosted: May 30th, '08, 17:10 

Joined: Apr 14th, '08, 11:28
Posts: 5
sorry for the delay, i overlooked the reply

Quote:
The code to do what exactly?



i was referring to this bit here...

Code:
it will still work because when they click on domain.com/spanish they will be redirected to spanish.domain.com but that means ALL requests for ALL non-english urls will be 301 redirected


rgds
dee


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB