Hi everyone,
I face a problem trying to complete a rewriting with some subdomains to serve static content and to avoid other pages of these subdomains to be accessed. Here is the explaination :
I have 2 subdomains to serve static content :
- img.domain.tld
- static.domain.tld
both pointing to same directory as www
Here is what i have in my .htaccess :
RewriteCond %{HTTP_HOST} !^(www|img|static).domain.tld$
RewriteRule ^(.*) http://www.domain.tld/$1 [QSA,L,R=301]
Static content is located in directories : /images/ and /local/
So you can get the static content for example :
- img.domain.tld/local/image.jpg
But you can also have :
- img.domain.tld/one-page.html
How could I also have a 301 to www for all pages not located in /images/ or /local/ ?
I'm afraid i'm stucked...
Many thanks