MyBB Community Forums

Full Version: .htaccess help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am using the Google SEO plugin and trying to setup a very simple redirect in my .htaccess file and was hoping someone could help out.

If someone goes to

http://YourName.mywebsite.com

I want it to redirect to

http://www.mywebsite.com/User-YourName

Obviously, every user will have have a different username.

Basically, so each user could give out a link as a subdomain that redirects to their actual plugin.

Would anyone there know how to do this? I'm sure it must be something simple but none of the tutorials I have been finding on Google have been very helpful...
Lets see if I still have the magic ^__^

Try this:

RewriteEngine On
RewriteCond %{HTTP_HOST} !(.*).mywebsite.com$
RewriteRule (.*) http://mywebsite.com/User-$1 [R=301,L]

Think I have something wrong on the second line though, bit too tired to think. Toungue
Not working for me Sad

When I enter that it makes my forum not load when I enter www at the beginning of the forum. Also, it doesn't actually make the redirect happen...

Thanks for trying though.
Did you read the directions in the attachment? They should help.
hmm

isn't subdomain.domain.com

usually actually located at

domain.com/subdomain

anyway?

who is your host?
No it is not that, for anyone, on any server.

If you create a subdomain in cpanel, by default it creates that directory in public_html and sets it as the document root for that subdomain in apache. However, you could have the document root as any folder you want.

I am trying to create a redirect using .htaccesss instead of having to create a manual subdomain redirect for every since single member.
(2011-05-10, 11:43 PM)Spazmatic Wrote: [ -> ]Did you read the directions in the attachment? They should help.

What in those instructions explains what I am asking about at all?
Doing a subdomain redirection like that probably belongs in httpd.conf instead of .htaccess . htaccess only affects requests in that folder or sub-folders.
i use a godaddy linux server.

all of my subdomains are located at:

domain.com/subdomain and masked to appear at subdomain.domain.com (actual file path)

that is why i asked who is host was.
(2011-05-11, 03:56 AM)laie_techie Wrote: [ -> ]Doing a subdomain redirection like that probably belongs in httpd.conf instead of .htaccess . htaccess only affects requests in that folder or sub-folders.

All I need it for it to redirect from the Document Root.