Jump to content
Mad_Griffith

Third level domain redirect without changing url

Recommended Posts

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 by Mad_Griffith

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 by Mad_Griffith

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...