Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I've got the following setup:
- domain1.com is my main domain, also the document root.
- domain2.com is an alias domain linked to domain1.com (used for variable spelling of the main domain, also .net or .de endings)
- domain5.com is another domain which is linked to domain1.com but should be handled differently.
- For domain5.com I need the following redirect:
- http://domain5.com -> http://domain1.com/subdir/
- http://www.domain5.com -> http://domain1.com/subdir/
- http://sub.domain5.com -> http://domain1.com/subdir/
- I've tried the following:
- #############################################################
- RewriteCond %{HTTP_HOST} ^(.*\.)?domain5\.com$ [NC]
- RewriteRule !^subdir/ /subdir%{REQUEST_URI} [L,R,NC]
- #############################################################
- which works for everything except the last case with the subdomain - this is due to the "alias" nature of this domain :/
- Since my main domain has a SSL certificate and thus every request should be handed over to https://
- no matter if the initial request was already HTTPS or not.
- http://domain1.com -> https://domain1.com/
- http://www.domain1.com -> https://domain1.com/
- http://foo.domain1.com -> https://foo.domain1.com/
- https://domain1.com -> https://domain1.com/
- https://www.domain1.com -> https://domain1.com/
- https://foo.domain1.com -> https://foo.domain1.com/
- One thing to note tho - all my subdomains are (server side) handled as symlinks pointing to the respective .sub-<name> folder,
- this has to be respected in the rules - if possible it would be nice to NOT display these folders (meaning, the URL should still read foo.domain1.com)
- foo.domain1.com -> domain1.com/.sub-foo/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement