Welcome Guest, Not a member yet? Register   Sign In
Multiple installations and Url Rewriting
#1

[eluser]jeanv[/eluser]
Hi everyone,

i have a question. I have created 3 websites running on a unique codeigniter installation. Each web site has its own application folder, and the root folder contains a folder by web site (that contains js, css, images and an htaccess file).

Using a specific htaccess file by web site i have taken off the "index.php" in the url.

so for the moment to access my websites i do:
www.mywebsite.fr/fr for the french web site
www.mywebsite.fr/en for the english one
www.mywebsite.fr/es for the spanish one...

BUT... that sucks ! because i have the domains .co.uk and .es ...
so, want i want to do is to access to www.mywebsite.fr/en with this url: www.mywebsite.en. Well in fact i know how to do that with an "invisible redirection", but the problem with this type of redirection is that the url never changes and remains for every page www.mywebsite.en.

So if i do a "normal redirection" the url becomes www.mywebsite.fr/en but i want it to appear like this: www.mywebsite.en/controller/function (instead of www.mywebsite.fr/en/controller/function)...

and i have no idea how to do that...
if someone has an idea that would be great !

Thanks a lot for reading !
#2

[eluser]jeanv[/eluser]
i suppose that something like that should work, but i cannot try it on a localhost:

Code:
RewriteCond %{HTTP_HOST} ^www\.mywebsite\.co.uk$
RewriteRule (.*) /application_CI_uk/ [QSA]

and

Code:
RewriteCond %{HTTP_HOST} ^www\.mywebsite\.es$
RewriteRule (.*) /application_CI_es/ [QSA]

and finally

Code:
RewriteCond %{HTTP_HOST} ^www\.mywebsite\.fr$
RewriteRule (.*) /application_CI_fr/ [QSA]

no idea ? how could i try that on a localhost ? (using wamp)
#3

[eluser]tomcode[/eluser]
@jeanv:

[quote author="jeanv" date="1238086960"]no idea ? how could i try that on a localhost ? (using wamp)[/quote]


You can edit Your hosts file (on both Mac and PC, linux surly, too).

On Mac You should find it here : /private/etc/hosts, if not search with include system files

Then in the file add entries as :


Code:
xxx.xxx.xxx.xxx     sub.domain.tld

Where xxx.xxx.xxx.xxx is the IP of Your machine, NOT 127.0.0.1

On Windows You need to restart the machine, on Mac it works instantly.

Do not forget to delete the entries after testing Wink




Theme © iAndrew 2016 - Forum software by © MyBB