1

I have a problem which I can't fix it. I explain you. I have a website like :

admin.myweb.com

So, I have the CSS, Javascripts in a folder called static and the "admin.myweb.com" needs to take that static files in this way:

static.admin.myweb.com

By now I have my "admin.myweb.com" and it runs well but without CSS,Javascript. So I've created a subdomain called "static.admin.miweb.com".

My problem is that I want the website goes to the folder "/instances/myweb/public/static", when it tries to go to static.admin.myweb.com . I've searched a lot and I tried a lot of httaccess codes but no one worked.

Basically I want to say something like : "when you receive static.admin.myweb.com, go to /instances/myweb/public/static".

I'm getting crazy with htaccess! Does anyone know how to do it? :)

1
  • I'm getting crazy with htaccess! and no response to below Answer :P Commented Oct 21, 2013 at 17:15

1 Answer 1

1

Assuming /instances/myweb/public is your website's root directory, place the following rules in your .htaccess file there:

RewriteEngine on
RewriteBase /

RewriteCond %{HTTP_HOST} ^static\.admin\.myweb\.com$ [NC]
RewriteCond %{REQUEST_URI} !^/static [NC]
RewriteRule ^(.*)$ /static/$1 [L]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.