CodeIgniter Forums
Multiple sites & linking to assets - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Multiple sites & linking to assets (/thread-27232.html)



Multiple sites & linking to assets - El Forum - 02-04-2010

[eluser]Anonymous[/eluser]
Hi,

I've got the following problem:

I have a local development webserver running with this setup:

Code:
-www
  -CLIENT1
    -application
    -system
    -assets
  -CLIENT2
    -application
    -system
    -assets

Each client map has its own .htacces like this:

Code:
RewriteEngine on
  RewriteBase /CLIENT1/
  RewriteCond $1 !^(index\.php|images|imgs|tmp|public|downloads|robots\.txt)
  RewriteRule ^(.*)$ index.php/$1 [L]

This way i can upload a clients map directly to a clients production server, with minimal changes.

Now i want to link in my view files to images like this:
Code:
<img src="/assets/test.jpg">

but!, and here's my problem: this way the images wil link on my development server to:
/assets/test.jpg
instead of
/CLIENT1/assets/test.jpg

Is there a way to redirect all calls from /assets/ to {CLIENT}/assets/ ?
my .htacces knowledge is really to short on this


Multiple sites & linking to assets - El Forum - 02-04-2010

[eluser]danmontgomery[/eluser]
They could be set up as virtualhosts in apache, where you can specify documentroot... You might be able to specify a 301 redirect in htaccess, but I can't help with that.


Multiple sites & linking to assets - El Forum - 02-04-2010

[eluser]Anonymous[/eluser]
hmm

i think i was explaining it bad Smile

All i want is a request that is made to:

Code:
http://localhost/assets/images/test.jpg
FROM
Code:
http://localhost/CLIENT1/controller/view
WILL BE REWRITTEN TO
Code:
http://localhost/CLIENT1/assets/images/test.jpg

where CLIENT1 is variable


Multiple sites & linking to assets - El Forum - 02-07-2010

[eluser]Anonymous[/eluser]
Ok, that was stupid.

What i wanted was multiple virtual hosts in Apache. (as noctrum suggested)

All works fine now, thanks.