I'm going nuts trying different combos, keep failing too.
I want http://mysite.com at all times.
I have content from 6 alias domains:
http://www.mysite.com
http://mysite.com
http://www.my-site.com
http://my-site.com
http://test.mysite.com
http://test.my-site.com
I need to write an htaccess file, using MOD REWRITE, that will redirect all 6 entries to http://mysite.com
ALSO NOTE that http://forum.mysite.com is a valid subdomain
I need to make sure it is the only "forum" domain.
Again, problems with
http://forum.test.mysite.com
http://forum.test.my-site.com
http://forum.mysite.com
http://forum.my-site.com
My eyes are going crossed trying to figure this out.
+ Reply to Thread
Results 1 to 9 of 9
-
Want my help? Ask here! (not via PM!)
FAQs: Best Blank Discs • Best TBCs • Best VCRs for capture • Restore VHS -
don't you want all sites -> http://www.mysite.com? isn't that the one google will look at? i thought they were now ignoring anything without it. i couldn't get their bot to even look at my sitemap without the www recently.
-
In the root of the domain you want to keep:
Code:RewriteCond %{HTTP_HOST} ^www.yoursite\.com$ [NC] RewriteRule ^(.*) http://yoursite.com/$1 [QSA,L,R=301] redirect 301 /forum/ http://forum.yoursite.com/
For the addtional domains/sub domains you want to redirect to http://yoursite.com I'd set up each domain as a valid domain in the control panel and add a htacess file in each root domain/sub-domain folder. Probably faster method assuming you have root access but that will certainly work. I've not messed around with alias much so I don't know what to suggest is proper easy way. You could try http://www.webmasterworld.com/apache/
Make sure to check that your sending the right response codes with http://web-sniffer.net/ or something similar.
Also make sure that it's redirecting to the right page, e.g. http://www.somsite.com/dvd.html should be redirecting too http://yoursite.com/dvd.html if its already been indexed by Google. You don't want to do a mass redirect to one page. This is bad:
Code:redirect 301 /forum/ http://forum.yoursite.com/index.html
Careful with all the redirection, it might bite you. :wink: -
Originally Posted by ßsimian
Google can care less which one it is but you only want it indexing one version. -
This is Apache code, I cannot use it:
"redirect 301 /forum/ http://forum.yoursite.com/index.html"
Plus it has always been installed at the subdomain forum.mysite.com, it's never been a subfolder.
I require ModRewrite code, which comes in this form:
RewriteCond, RewriteRule
Altering the hosting/DNS is not an option. Inside Plesk, I've got mysite.com (+www), ..... and then as a domain alias, I've got my-site.com (+www) and test.mysite.com -- this is all inside Plesk 8.4 and there's no way to alter it to another type of hosting option.
I've got these 6 aliases, and I have to figure out a way to mod rewrite forward them to only show the version I want accessible.
This is using IIS6 with the installed Micronovae Mod Rewrite Pro (100% compatible to Apache's Mod Rewrite).Want my help? Ask here! (not via PM!)
FAQs: Best Blank Discs • Best TBCs • Best VCRs for capture • Restore VHS -
Don't know if this will help at all : http://www.blogstorm.co.uk/htaccess-mod_rewrite-ultimate-guide/ - first section on canonicalization
Read my blog here.
-
Well I'm lost as soon as you say Windows...
Where are you placing the htacess files, on an apache server they can be placed in any directory. You don';t have to write a single one for every domain but you can make individual ones.
This takes care of the www issue and will rewrite any url that starts with a www:
Code:RewriteCond %{HTTP_HOST} ^www.yoursite\.com$ [NC] RewriteRule ^(.*) http://yoursite.com/$1 [QSA,L,R=301]
Why not just dump Windows? :P -
ASP, ASP.NET and MS SQL
Want my help? Ask here! (not via PM!)
FAQs: Best Blank Discs • Best TBCs • Best VCRs for capture • Restore VHS -
Code:
if ($server == 'windows') { echo 'arrrrrrrrrrrrrrrrrrghhh'; } else { echo 'Yeeeeeeeea baaaaaaaaby'; }
Windows doesn't have it's own redirection or rewrite features? Can you do the redirection with a ASP script?
Similar Threads
-
htaccess help?
By lordsmurf in forum ComputerReplies: 3Last Post: 10th Mar 2008, 09:10