Jump to content

Recommended Posts

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

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.

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

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?

Posted

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.

Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...