Forum Moderators: phranque
Great place here so far, unfortunately I'm such a newb at this it's a bit hard to grasp and unfortunately I need my site back up ASAP, so I don't have time to learn this now (but I sure will soon, looks like a great tool).
Anyway what I need done is any and every old page I previously had of site (not sure what links out there still exist) redirect to my forums sub-domain.
I in fact have 2 sub-domains I need to use solely for site. The 2nd being billing so I need direct links to that working even after redirect in place.
I've found this and thought it would help but no luck...
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com [NC]
RewriteRule ^(.*)$ /community/$1 [L]
of course the 'domain' has my real url in it.
Any ideas and or advice?
Thanks in advance,
Eric
Welcome to WebmasterWorld [webmasterworld.com]!
> I don't have time to learn this
No time like the present...
You state that you want to redirect to your forums subdomain, but you show a rewrite to your /community subdirectory. Please detail what you need to do.
Jim
I didn't mean I wouldn't learn it, just that I normally wouldn't post and would spend time searching.
In this case I was hoping posting may be a bit faster and more direct. In future I'll search first.
Yeah I grabbed a snippet off a post here that seemed related, most likely why it doesn't work :P
What I want is 1 of 2 things:
1) my forums (what is now a subdomain 'community')
to appear directly under www.mydomain.com.
I also need subdomains to work normally for other aspect of site (e.g 'secure.domain.com') so clients can login to billing portion of site.
2) For all old pages, that no longer exist (e.g. index.php/support.php etc) to redirect to community.mydomain.com.
Number 1 would look nicer but either way as long as the 'community' appears as main site, thats fine.
Regards
RewriteCond %{HTTP_HOST} ^www\.domain\.com [NC]
You can use the Apache [httpd.apache.org] ErrorDocument directive to point all 404-Not Found pages to s specific page, but I don't recommend that from a usability standpoint -- it is better to redirect users to a site map page that explains what is going on.
Jim
you have the www.domain.com, the community.domain.com and some other.domain.com addresses.
the first you want to do is to change the [community[...] to the [domain.com[b]...] but you want to have the requests for the old url to be redirected to the new one?
and you want to send *every* browser which ends up on a page which does not exists anymore to the www.domain.com/community url? or just for some files which was removed recently? or maybe for every request arriving to the root of the www.domain.com?
hope some of these alternatives are about what you'd like to implement.
I am sorry if I made it more confusing, I have a tendency of Doing that :(
What I wanted to say is:
I want www.domain.com to either show the contents of community.domain.com (while displaying www.domain.com in address bar) or at least redirect to community.mydomain.com (and that URL shows in address bar).
The community.domain.com part of site now, will be 'the site'. I want the forums the first thing everyone sees, and I want it so that even if they would normally get a 404 error page, instead they go to the forums.
My thing, and I don't know if I should even worry about this, I need other subdomains (e.g. secure.domain.com) to still work normally.
Again thanks for replies and helpin out :D
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com
RewriteRule ^(.*)$ http://community.mydomain.com/$1 [R]
would this help? let me know...
I'm looking in my post something similar...
but I cannot touch http.conf and I want transparent redirection....
luck!
That worked fine for showing the URL of 'community.domain.com'.
Other subdomains work properly so that's a plus.
Only negative thing is things such as domain.com/support/ doesn't work, as it redirects to community.domain.com/support/.
But that is no big deal as I use subdomains and not subfolders.
If i can do same thing and have it display the www.domain.com instead, that be a big plus :D
I assume I need to do it via httpd.conf , so now that site is up I will take time to search and learn :D
Also I have to search for 404 redirects ;)
Thanks much for your patience and help, I think I am going to like it here :D