Mad_Griffith Posted March 18, 2019 Share Posted March 18, 2019 (edited) Hi, I am trying to have my.website.tld redirect to www.website.tld/my. The constraints: 1) "my" is not a folder, but a Wordpress category with posts. 2) I would like to keep the url as "my.website.tld" How can I accomplish that? Thank you. Edited March 18, 2019 by Mad_Griffith Link to comment Share on other sites More sharing options...
justsomeguy Posted March 18, 2019 Share Posted March 18, 2019 You need a rewrite rule to redirect that subdomain or any subdomain to the other URL. You also need to set up DNS for the subdomain. Link to comment Share on other sites More sharing options...
Mad_Griffith Posted March 18, 2019 Author Share Posted March 18, 2019 (edited) I have this rewrite rule RewriteCond %{HTTP_HOST} ^DomainA.com RewriteRule ^(.*) http://DomainB.com/PathToPageHere [P] but it just acts as a normal redirect (the address changes). Edited March 18, 2019 by Mad_Griffith Link to comment Share on other sites More sharing options...
justsomeguy Posted March 19, 2019 Share Posted March 19, 2019 Are you using mod_proxy? Why do you have it using a proxy to do that? Is there anything else that might do the redirect? Maybe the page itself is redirecting? Link to comment Share on other sites More sharing options...
Mad_Griffith Posted March 19, 2019 Author Share Posted March 19, 2019 (edited) "Example 2" on this page. In my case, the server and domain name is always the same. Edited March 19, 2019 by Mad_Griffith Link to comment Share on other sites More sharing options...
Mad_Griffith Posted March 19, 2019 Author Share Posted March 19, 2019 And I am also wondering why something like this is incorrect: RewriteCond %{HTTP_HOST} my.website.com RewriteRule ^(?:https\:\/\/)?\w*\.(.+) www.$1/my [P] The pattern is syntactically correct. Link to comment Share on other sites More sharing options...
justsomeguy Posted March 19, 2019 Share Posted March 19, 2019 Is Inmotion your host? I've never set up htaccess to use a proxy at all, I didn't even realize that was an option frankly. Regardless, if the URL is changing then it sounds like it's not even using that rule. I can't say why, because I'm not sitting there watching you, but maybe there is another rule. Do you have anything else in htaccess? Is your site set up to look at the domain and redirect to another one? The pattern is syntactically correct. Is it? Go through that pattern and tell me what each part means. Also tell me why you're using a replacement for the domain name, and what that replacement is going to be. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now