Welcome Guest, Not a member yet? Register   Sign In
Multiple sites & linking to assets
#1

[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
#2

[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.
#3

[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
#4

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

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

All works fine now, thanks.




Theme © iAndrew 2016 - Forum software by © MyBB