Edited by Randy, 30 July 2007 - 02:19 PM.
To break unintentional links.
Are you a Google Analytics enthusiast?
Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE!

www.CustomReportSharing.com
From the folks who brought you High Rankings!
More SEO Content
International SEM | Social Media | Search Friendly Design | SEO | Paid Search / PPC | Seminars | Forum Threads | Q&A | Copywriting | Keyword Research | Web Analytics / Conversions | Blogging | Dynamic Sites | Linking | SEO Services | Site Architecture | Search Engine Spam | Wrap-ups | Business Issues | HRA Questions | Online Courses
301 Vs 302 Redirects And Rankings
Started by
designbug
, Nov 24 2006 11:30 AM
37 replies to this topic
#31
Posted 30 July 2007 - 02:10 PM
My situation is getting mydomain.com to point to www.mydomain.com so the page rank is not divided between the two (even though they are the same site). And I am also wanting the same for www.subdomain.mydomain.com pointing to www.mydomain.com/subdomain.html
#32
Posted 30 July 2007 - 02:17 PM
You'll definitely want those to be 301's. A 302 would simply exacerbate the problem.
What type of server platform are you on? Unix/Linux or Windows/IIS?
There are also lots of threads about various ways to do redirects down in our redirects forum in the Technology section.
What type of server platform are you on? Unix/Linux or Windows/IIS?
There are also lots of threads about various ways to do redirects down in our redirects forum in the Technology section.
#33
Posted 30 July 2007 - 11:47 PM
Ok, now I'm back to my problems on my other post.
Just how to do a 301 redirect. I thought I had it under figured out until I realized my hosting company sends a 302 redirect instead of a 301.
Should I post back there or here?
Here it goes... My hosting company says to use a index.php file. So if I put
in my root directory and everything should 301 redirect to www.mydomain.com. Is this correct?
Oh, THANKS again Randy!!!
Should I post back there or here?
Here it goes... My hosting company says to use a index.php file. So if I put
CODE
<BR><?php</P> <P>Header( "HTTP/1.1 301 Moved Permanently" );<BR>Header( "Location: <A href="http://www.mydomain.com">http://www.mydomain.com</A>" );<BR>exit();</P> <P>?><BR><BR>
in my root directory and everything should 301 redirect to www.mydomain.com. Is this correct?
Oh, THANKS again Randy!!!
#34
Posted 31 July 2007 - 04:43 AM
Absolutely not. Is that some code the host gave you??
As it stands, that code will simply cause errors, apart from it not being correct, the code is also trying to redirect after browser output has been sent.
This is how it is done with ASP (seeing as you are hosted on IIS 6) http://www.highranki...mp;#entry117701
Doesn't handle querystrings from standard but how to add that functionality is covered a few posts further down.
Because all your pages are .html extensions you WILL need to get your hosting co to set the application mappings to parse .html as asp, it is NOT a security risk as they will try to tell you and it will NOT put a huge additional load on the server (that went out with IIS 4).
If they do not know how to change the mappings, I have a walk through at http://www.candsdesi...ings/site-only/
IF they cannot manage to make it all work, or refuse, ( in either case getting a more enlightened host would be advisable ). The other option is to have two hosting configuration, one with a hostheader for the www version, the second for the non-www hostheader set with a permanent redirect ( walkthrough at http://www.candsdesi.../site-redirect/ )
I haven't written up the walkthrough on hostheaders as yet
As it stands, that code will simply cause errors, apart from it not being correct, the code is also trying to redirect after browser output has been sent.
This is how it is done with ASP (seeing as you are hosted on IIS 6) http://www.highranki...mp;#entry117701
Doesn't handle querystrings from standard but how to add that functionality is covered a few posts further down.
Because all your pages are .html extensions you WILL need to get your hosting co to set the application mappings to parse .html as asp, it is NOT a security risk as they will try to tell you and it will NOT put a huge additional load on the server (that went out with IIS 4).
If they do not know how to change the mappings, I have a walk through at http://www.candsdesi...ings/site-only/
IF they cannot manage to make it all work, or refuse, ( in either case getting a more enlightened host would be advisable ). The other option is to have two hosting configuration, one with a hostheader for the www version, the second for the non-www hostheader set with a permanent redirect ( walkthrough at http://www.candsdesi.../site-redirect/ )
I haven't written up the walkthrough on hostheaders as yet
#35
Posted 31 July 2007 - 08:46 AM
The code above, although all messed up in formatting, is the same as from this post.
http://www.highranki...h...ost&p=60621
The example on this site is also the same as above except ASP instead of PHP.
http://www.highranki...h...st&p=213002
So why won't the code work?
http://www.highranki...h...ost&p=60621
The example on this site is also the same as above except ASP instead of PHP.
http://www.highranki...h...st&p=213002
So why won't the code work?
#36
Posted 31 July 2007 - 09:45 AM
Because it's got all those <br> and <p> tags mixed in the middle of it.
It has to be the very very very very first thing in the code on the page. Even before the DTD statement and the <head> tag. Up where line breaks and paragraph tags fear to tread.
--Torka
It has to be the very very very very first thing in the code on the page. Even before the DTD statement and the <head> tag. Up where line breaks and paragraph tags fear to tread.
--Torka
#37
Posted 31 July 2007 - 09:46 AM
It will work in it's original form without the bits of HTML code mixed in with it
BUT it will simply redirect every page to the home page. That code as it stands is fine for a new site/hostname that has NOT been indexed.
BUT it will simply redirect every page to the home page. That code as it stands is fine for a new site/hostname that has NOT been indexed.
#38
Posted 31 July 2007 - 12:20 PM
This is what my post was suppose to look like. My formatting keeps getting messed up when I post.
I am forwarding Ian's article, http://www.mcanerin....edirect-IIS.asp, on IIS redirects to my hosting service and see what they can do.
According to the above article, it sounds like my best option is to have a separate non www account with either the php or asp redirect code in it.
Do you agree or am I still completly missing it?
I don't know if they will do this,but I'll see.
CODE
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.newdomain.com/newdir/newpage.htm");
exit();
header("Location: http://www.newdomain.com/newdir/newpage.htm");
exit();
I am forwarding Ian's article, http://www.mcanerin....edirect-IIS.asp, on IIS redirects to my hosting service and see what they can do.
According to the above article, it sounds like my best option is to have a separate non www account with either the php or asp redirect code in it.
Do you agree or am I still completly missing it?
I don't know if they will do this,but I'll see.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users








