Discuss 301 redirect index.asp in the Google Optimization forum on SEO Chat. 301 redirect index.asp Google Optimization forum discussing techniques to increase rank in Google. Find help for defeating spam pages, building site trust, and beating the Google algorithm. Also read about the best SEO tools to help with Google search.
BuySellLinks.com is a new Text Link Advertising Brokerage by the founder of LinkAdage that offers high-end text links and a premier membership base. We screen all advertisers and publishers and their web pages to make sure we are offering a service that works for everyone. Our plug-in is super easy to install but if you are hands off, w e offer free installation.
Tired of dealing with shady text link buyers and/or sellers? Try BuySellLinks.
Receive the tools necessary to be the rock star of your field. Our 12-month program teaches you the evolving world of multi-channel marketing as well as the complex issues and opportunities found in the industry.
Posts: 2,763
Time spent in forums: 1 Month 2 Weeks 1 Day 2 h 34 m 51 sec
Reputation Power: 196
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.
__________________ You do your business I do mine, because you are you and I am I, If we meet it is nice. Starting a SEO Company | Some SEO Tips
Posts: 79
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.
Posts: 1,728
Time spent in forums: 2 Weeks 5 Days 10 h 15 m 42 sec
Reputation Power: 237
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.
Posts: 4,016
Time spent in forums: 3 Months 1 Day 30 m 12 sec
Reputation Power: 482
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?
Posts: 2,763
Time spent in forums: 1 Month 2 Weeks 1 Day 2 h 34 m 51 sec
Reputation Power: 196
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....
Posts: 2,763
Time spent in forums: 1 Month 2 Weeks 1 Day 2 h 34 m 51 sec
Reputation Power: 196
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.
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
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
%>
in default.asp
now when we open index.asp it move to / and when we open non www it also move to www and it works you can also try thanks seomonkeymanocp you got this answer more than 3 months thank for all seo chat members now I can say this is most informative forum in the world I will add free link in my home page and title we be most informative forums