Google Optimization
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   SEO Chat ForumsGoogleGoogle Optimization

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread SEO Chat Forums Sponsor:
  #1  
Old August 14th, 2008, 06:22 AM
Prof.stan Prof.stan is offline
Contributing User
SEO Chat Intermediate (1500 - 1999 posts)
 
Join Date: Oct 2007
Posts: 1,649 Prof.stan User rank is Sergeant (500 - 2000 Reputation Level)Prof.stan User rank is Sergeant (500 - 2000 Reputation Level)Prof.stan User rank is Sergeant (500 - 2000 Reputation Level)Prof.stan User rank is Sergeant (500 - 2000 Reputation Level)Prof.stan User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Weeks 3 Days 15 h 55 m 3 sec
Warnings Level: 5
Number of bans: 1
Reputation Power: 12
301 redirect index.asp

<%

If InStr(Request.ServerVariables("SERVER_NAME"),"www") = 0 Then

Response.Status="301 Moved Permanently"
Response.AddHeader "Location","http://www." & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("REQUEST_URI")
Response.End

End if


%>
This code is working go non www to www but I need another code for index.asp to www for my client site my client using iss server shared server…..
Help require I have search complete seo chat but I didn’t get proper answer for this.

Reply With Quote
  #2  
Old August 14th, 2008, 06:26 AM
seo-gurgaon seo-gurgaon is offline
Permanently Banned
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Jun 2008
Location: India
Posts: 80 seo-gurgaon User rank is Lance Corporal (50 - 100 Reputation Level)seo-gurgaon User rank is Lance Corporal (50 - 100 Reputation Level)seo-gurgaon User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Day 11 h 18 m 30 sec
Warnings Level: 10
Number of bans: 1
Reputation Power: 0
Quote:
Originally Posted by Prof.stan
<%

If InStr(Request.ServerVariables("SERVER_NAME"),"www") = 0 Then

Response.Status="301 Moved Permanently"
Response.AddHeader "Location","http://www." & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("REQUEST_URI")
Response.End

End if


%>
This code is working go non www to www but I need another code for index.asp to www for my client site my client using iss server shared server…..
Help require I have search complete seo chat but I didn’t get proper answer for this.


try isapirewrite.com

Reply With Quote
  #3  
Old August 14th, 2008, 06:31 AM
Prof.stan Prof.stan is offline
Contributing User
SEO Chat Intermediate (1500 - 1999 posts)
 
Join Date: Oct 2007
Posts: 1,649 Prof.stan User rank is Sergeant (500 - 2000 Reputation Level)Prof.stan User rank is Sergeant (500 - 2000 Reputation Level)Prof.stan User rank is Sergeant (500 - 2000 Reputation Level)Prof.stan User rank is Sergeant (500 - 2000 Reputation Level)Prof.stan User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Weeks 3 Days 15 h 55 m 3 sec
Warnings Level: 5
Number of bans: 1
Reputation Power: 12
Quote:
Originally Posted by seo-gurgaon
try isapirewrite.com

It’s for server end and I know it read my post I am asking code for source which may directly paste in my root page?

Reply With Quote
  #4  
Old August 14th, 2008, 06:33 AM
seomonkeymanocp's Avatar
seomonkeymanocp seomonkeymanocp is offline
Live and Learn!
SEO Chat Beginner (1000 - 1499 posts)
 
Join Date: Jun 2006
Location: London, England
Posts: 1,016 seomonkeymanocp User rank is Sergeant (500 - 2000 Reputation Level)seomonkeymanocp User rank is Sergeant (500 - 2000 Reputation Level)seomonkeymanocp User rank is Sergeant (500 - 2000 Reputation Level)seomonkeymanocp User rank is Sergeant (500 - 2000 Reputation Level)seomonkeymanocp User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 10 h 30 m 43 sec
Reputation Power: 18
Send a message via MSN to seomonkeymanocp
on the server you need to make a new "DEFAULT" page for folders. so for instance you will have a list of the default pages that get priority when you go to a folder:

1. index.asp
2. index.html
3. main.asp

etc... If index.asp does not exist the server will try to show index.html and then main.asp and so on.

so what you need to do is make the index.asp always redirect to the root of the page and create a default.asp (or something that no one would consider linking to or typing into the browser).

What you then need to do is to set this default.asp as the default file for folders like the following:

1. default.asp
2. index.asp
3. main.asp

This way whenever someone goest to the root of your website it will show default.asp, but if someone goes to your index.asp page it will redirect to the root.

This is how i do it anyway and it works fine.

Reply With Quote
  #5  
Old August 14th, 2008, 06:43 AM
pro_seo's Avatar
pro_seo pro_seo is offline
Moderator
SEO Chat Frequenter (2500 - 2999 posts)
 
Join Date: Apr 2006
Location: I N D I A
Posts: 2,908 pro_seo User rank is Sergeant Major (2000 - 5000 Reputation Level)pro_seo User rank is Sergeant Major (2000 - 5000 Reputation Level)pro_seo User rank is Sergeant Major (2000 - 5000 Reputation Level)pro_seo User rank is Sergeant Major (2000 - 5000 Reputation Level)pro_seo User rank is Sergeant Major (2000 - 5000 Reputation Level)pro_seo User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Month 3 Weeks 6 Days 17 h 53 m 24 sec
Reputation Power: 40
Send a message via MSN to pro_seo Send a message via Yahoo to pro_seo Send a message via Google Talk to pro_seo Send a message via Skype to pro_seo
Quote:
Originally Posted by seomonkeymanocp
on the server you need to make a new "DEFAULT" page for folders. so for instance you will have a list of the default pages that get priority when you go to a folder:

1. index.asp
2. index.html
3. main.asp

etc... If index.asp does not exist the server will try to show index.html and then main.asp and so on.

so what you need to do is make the index.asp always redirect to the root of the page and create a default.asp (or something that no one would consider linking to or typing into the browser).

What you then need to do is to set this default.asp as the default file for folders like the following:

1. default.asp
2. index.asp
3. main.asp

This way whenever someone goest to the root of your website it will show default.asp, but if someone goes to your index.asp page it will redirect to the root.

This is how i do it anyway and it works fine.


Thanks for the instructions...but how do you redirect index.asp to the root?
Comments on this post
Prof.stan agrees: hi can i send you pms for this have you solutions for this i will send client site url also
__________________

SEO FAQs - You might find your answer here.
SEOchat Forum Rules - Read Before You Post


**Do what you feel in your heart to be right- for you'll be criticized anyway. You'll be damned if you do, and damned if you don't.**

Reply With Quote
  #6  
Old August 14th, 2008, 06:46 AM
Prof.stan Prof.stan is offline
Contributing User
SEO Chat Intermediate (1500 - 1999 posts)
 
Join Date: Oct 2007
Posts: 1,649 Prof.stan User rank is Sergeant (500 - 2000 Reputation Level)Prof.stan User rank is Sergeant (500 - 2000 Reputation Level)Prof.stan User rank is Sergeant (500 - 2000 Reputation Level)Prof.stan User rank is Sergeant (500 - 2000 Reputation Level)Prof.stan User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Weeks 3 Days 15 h 55 m 3 sec
Warnings Level: 5
Number of bans: 1
Reputation Power: 12
actually my problem is in my past i solved a canonical problem this website was in php I used
<?php if (substr($_SERVER['HTTP_HOST'],0,3) != 'www')
{
header('HTTP/1.1 301 Moved Permanently');
header('Location: http://www.' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
}
if ($_SERVER['REQUEST_URI'] == '/index.php')
{
header( 'HTTP/1.1 301 Moved Permanently' );
header( 'Location: http://www.myclientwebsite.com/' );
}
?>

It works non www to www and index.php to www
and I added it in my home page header

and I have another client website create in asp
I used code for non www to www is
<%

If InStr(Request.ServerVariables("SERVER_NAME"),"www") = 0 Then

Response.Status="301 Moved Permanently"
Response.AddHeader "Location","http://www." & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("REQUEST_URI")
Response.End

End if
%>
but I mann't redirect it for index.asp to www if you have any code for this which is i can directly add then please provide me even I search it from webmaster world and completely seo chat but I did get proper answer for this is our client site using IIS server and it is shared hosted....

Reply With Quote
  #7  
Old August 14th, 2008, 06:50 AM
Prof.stan Prof.stan is offline
Contributing User
SEO Chat Intermediate (1500 - 1999 posts)
 
Join Date: Oct 2007
Posts: 1,649 Prof.stan User rank is Sergeant (500 - 2000 Reputation Level)Prof.stan User rank is Sergeant (500 - 2000 Reputation Level)Prof.stan User rank is Sergeant (500 - 2000 Reputation Level)Prof.stan User rank is Sergeant (500 - 2000 Reputation Level)Prof.stan User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Weeks 3 Days 15 h 55 m 3 sec
Warnings Level: 5
Number of bans: 1
Reputation Power: 12
Quote:
Originally Posted by pro_seo
Thanks for the instructions...but how do you redirect index.asp to the root?

Yes same question I would like to ask I need code for this I think many times I asked this question in differ forums in this forum also but people send me some redirect ulr some are webconfs, webmaster world, I have read all the website from more than 3 months but still no solutions.

Reply With Quote
  #8  
Old August 14th, 2008, 06:54 AM
seomonkeymanocp's Avatar
seomonkeymanocp seomonkeymanocp is offline
Live and Learn!
SEO Chat Beginner (1000 - 1499 posts)
 
Join Date: Jun 2006
Location: London, England
Posts: 1,016 seomonkeymanocp User rank is Sergeant (500 - 2000 Reputation Level)seomonkeymanocp User rank is Sergeant (500 - 2000 Reputation Level)seomonkeymanocp User rank is Sergeant (500 - 2000 Reputation Level)seomonkeymanocp User rank is Sergeant (500 - 2000 Reputation Level)seomonkeymanocp User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 10 h 30 m 43 sec
Reputation Power: 18
Send a message via MSN to seomonkeymanocp
Quote:
Originally Posted by pro_seo
Thanks for the instructions...but how do you redirect index.asp to the root?


Ok so you have your main template (homepage) on a default.asp, so on the index.asp just put:

<%
' Permanent redirection
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", "/"
Response.End
%>

This will always redirect the index.asp to the root of the website which has been told to grab the randomed named file which in this instance i called default.asp
Comments on this post
pro_seo agrees: Thanks a lot...I will check how this works.

Reply With Quote
  #9  
Old August 14th, 2008, 07:06 AM
pro_seo's Avatar
pro_seo pro_seo is offline
Moderator
SEO Chat Frequenter (2500 - 2999 posts)
 
Join Date: Apr 2006
Location: I N D I A
Posts: 2,908 pro_seo User rank is Sergeant Major (2000 - 5000 Reputation Level)pro_seo User rank is Sergeant Major (2000 - 5000 Reputation Level)pro_seo User rank is Sergeant Major (2000 - 5000 Reputation Level)pro_seo User rank is Sergeant Major (2000 - 5000 Reputation Level)pro_seo User rank is Sergeant Major (2000 - 5000 Reputation Level)pro_seo User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Month 3 Weeks 6 Days 17 h 53 m 24 sec
Reputation Power: 40
Send a message via MSN to pro_seo Send a message via Yahoo to pro_seo Send a message via Google Talk to pro_seo Send a message via Skype to pro_seo
And do u know the code that will accomplish this in .NET ?

Reply With Quote
  #10  
Old August 14th, 2008, 07:06 AM
Prof.stan Prof.stan is offline
Contributing User
SEO Chat Intermediate (1500 - 1999 posts)
 
Join Date: Oct 2007
Posts: 1,649 Prof.stan User rank is Sergeant (500 - 2000 Reputation Level)Prof.stan User rank is Sergeant (500 - 2000 Reputation Level)Prof.stan User rank is Sergeant (500 - 2000 Reputation Level)Prof.stan User rank is Sergeant (500 - 2000 Reputation Level)Prof.stan User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Weeks 3 Days 15 h 55 m 3 sec
Warnings Level: 5
Number of bans: 1
Reputation Power: 12
you mean to say i have put in my index.asp page
it will work for non www to www and index.asp to www
<%

If InStr(Request.ServerVariables("SERVER_NAME"),"www") = 0 Then

Response.Status="301 Moved Permanently"
Response.AddHeader "Location","http://www." & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("REQUEST_URI")
Response.End

End if

' Permanent redirection
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", "/"
Response.End
%>

Reply With Quote
  #11  
Old August 14th, 2008, 07:08 AM
Prof.stan Prof.stan is offline
Contributing User
SEO Chat Intermediate (1500 - 1999 posts)
 
Join Date: Oct 2007
Posts: 1,649 Prof.stan User rank is Sergeant (500 - 2000 Reputation Level)Prof.stan User rank is Sergeant (500 - 2000 Reputation Level)Prof.stan User rank is Sergeant (500 - 2000 Reputation Level)Prof.stan User rank is Sergeant (500 - 2000 Reputation Level)Prof.stan User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Weeks 3 Days 15 h 55 m 3 sec
Warnings Level: 5
Number of bans: 1
Reputation Power: 12
Quote:
pro_seo agrees: Thanks a lot...I will check how this works.

it is for both things or only fro index.asp my dear.

Reply With Quote
  #12  
Old August 14th, 2008, 07:20 AM
pro_seo's Avatar
pro_seo pro_seo is offline
Moderator
SEO Chat Frequenter (2500 - 2999 posts)
 
Join Date: Apr 2006
Location: I N D I A
Posts: 2,908 pro_seo User rank is Sergeant Major (2000 - 5000 Reputation Level)pro_seo User rank is Sergeant Major (2000 - 5000 Reputation Level)pro_seo User rank is Sergeant Major (2000 - 5000 Reputation Level)pro_seo User rank is Sergeant Major (2000 - 5000 Reputation Level)pro_seo User rank is Sergeant Major (2000 - 5000 Reputation Level)pro_seo User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Month 3 Weeks 6 Days 17 h 53 m 24 sec
Reputation Power: 40
Send a message via MSN to pro_seo Send a message via Yahoo to pro_seo Send a message via Google Talk to pro_seo Send a message via Skype to pro_seo
Quote:
Originally Posted by Prof.stan
it is for both things or only fro index.asp my dear.


Only from /index.asp to root.

If you want to redirect non-www to www in IIS, then this is the way I do it.

Login to your IIS and create a new website with the host name of domain.com

Right click on this website and select properties.

Go to the Home Directory tab and check the "A redirection to a URL"

Enter the www version of your website in the Redirect to field and add a few suffixes

such as http://www.domain.com$S$Q

Check "A permanent redirection to this resource"

Click ok and all should be set
Comments on this post
Prof.stan agrees: write 2nd code in default.asp and you will find you canonical have been sort out

Last edited by pro_seo : August 14th, 2008 at 07:23 AM.

Reply With Quote
  #13  
Old August 14th, 2008, 07:36 AM
seomonkeymanocp's Avatar
seomonkeymanocp seomonkeymanocp is offline
Live and Learn!
SEO Chat Beginner (1000 - 1499 posts)
 
Join Date: Jun 2006
Location: London, England
Posts: 1,016 seomonkeymanocp User rank is Sergeant (500 - 2000 Reputation Level)seomonkeymanocp User rank is Sergeant (500 - 2000 Reputation Level)seomonkeymanocp User rank is Sergeant (500 - 2000 Reputation Level)seomonkeymanocp User rank is Sergeant (500 - 2000 Reputation Level)seomonkeymanocp User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 10 h 30 m 43 sec
Reputation Power: 18
Send a message via MSN to seomonkeymanocp
Quote:
Originally Posted by pro_seo
And do u know the code that will accomplish this in .NET ?


afraid not, im still trying to get my head around .net. If i do i will let you know.

Reply With Quote
  #14  
Old August 14th, 2008, 10:20 AM
Prof.stan Prof.stan is offline
Contributing User
SEO Chat Intermediate (1500 - 1999 posts)
 
Join Date: Oct 2007
Posts: 1,649 Prof.stan User rank is Sergeant (500 - 2000 Reputation Level)Prof.stan User rank is Sergeant (500 - 2000 Reputation Level)Prof.stan User rank is Sergeant (500 - 2000 Reputation Level)Prof.stan User rank is Sergeant (500 - 2000 Reputation Level)Prof.stan User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Weeks 3 Days 15 h 55 m 3 sec
Warnings Level: 5
Number of bans: 1
Reputation Power: 12