Webmaster Forum

Ezilon Directory   1,000 Directory Submissions   V7N Directory
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Reply
 
LinkBack Thread Tools Display Modes
Old 06-17-2007, 06:06 PM   #1 (permalink)
Inactive
 
Join Date: 06-17-07
Posts: 6
iTrader: 0 / 0%
Latest Blog:
None

bomy is liked by many
Question 301 asp rewrite?

Hello All

I am new here and have a rather painful question. I have searched and searched for the answer.

I have a site that is about 1 year old. Despite all my best efforts and many errors it ranks #50 to 70 for my main key words but pages 1, 2 or 3 for most of my secondary.

I have had many double indexing problems from the beginning some from linking errors, etc. One problem has occurred because my demo store contained links that link to the hosts server pages.

I am indexed as www.mydomain.com as well as www.mydomain.myhostsname.com. The host address is in the supplemental index in google but in MSN some of those pages actually rank higher than my .com pages.

I

My Windows IIS host said that they would put in some kind of no follow code but I constantly keep getting linked to by these google ad pages that are linking the the hostname address. I still have my entire site indexed under both domains.

I found the following code to use regarding the www vs non www version pages (which I also have a problem with but only in MSN as far as I know)
I need some sort of asp rewrite that will address both issues.

Does anyone know of such a code. I want it to be safe. I can't seem to get rid of these stupid duplicate addresses. My host does not have a rewrite ini file.

Thanks in advance for your input.

Bomy
bomy is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 06-17-2007, 06:08 PM   #2 (permalink)
Inactive
 
Join Date: 06-17-07
Posts: 6
iTrader: 0 / 0%
Latest Blog:
None

bomy is liked by many
Code

Sorry forgot to include the code.


Dim Domain_Name, theURL, QUERY_STRING, HTTP_PATH
Domain_Name = lcase(request.ServerVariables("HTTP_HOST"))
if domain_name <> "www.example.com" Then
HTTP_PATH = request.ServerVariables("PATH_INFO")
If Left(HTTP_PATH, = "/default" Then
HTTP_PATH = ""
End If
QUERY_STRING = request.ServerVariables("QUERY_STRING")
theURL = "http://www.example.com" & HTTP_PATH
if len(QUERY_STRING) > 0 Then
theURL = theURL & "?" & QUERY_STRING
end if
Response.Clear
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", theURL
Response.Flush
Response.End
end if
bomy is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-17-2007, 06:57 PM   #3 (permalink)
v7n Mental
 
waffles's Avatar
 
Join Date: 06-30-06
Location: Not where I want to be.
Posts: 1,485
iTrader: 1 / 100%
waffles is a name known to allwaffles is a name known to allwaffles is a name known to allwaffles is a name known to allwaffles is a name known to allwaffles is a name known to allwaffles is a name known to allwaffles is a name known to allwaffles is a name known to allwaffles is a name known to allwaffles is a name known to all
Send a message via AIM to waffles
I know what you need, and unless someone beats me to it I'll be back later with some code that you should be able to copy and paste and use just as I write it.
__________________
waffles Radio - Back on the air. Listen Mondays from 4-6 or catch the bootleg whenever

Juggle Chainsaws What happens when a college kid gets the bright idea to write
waffles is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-17-2007, 07:10 PM   #4 (permalink)
Inactive
 
Join Date: 06-17-07
Posts: 6
iTrader: 0 / 0%
Latest Blog:
None

bomy is liked by many
Perfect I'll be checking in, Thanks

Thanks
bomy is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-17-2007, 07:55 PM   #5 (permalink)
v7n Mental
 
waffles's Avatar
 
Join Date: 06-30-06
Location: Not where I want to be.
Posts: 1,485
iTrader: 1 / 100%
waffles is a name known to allwaffles is a name known to allwaffles is a name known to allwaffles is a name known to allwaffles is a name known to allwaffles is a name known to allwaffles is a name known to allwaffles is a name known to allwaffles is a name known to allwaffles is a name known to allwaffles is a name known to all
Send a message via AIM to waffles
Alright, since you're online I'll assume that you're watching this. Do you have the ability to edit your .htaccess file?
__________________
waffles Radio - Back on the air. Listen Mondays from 4-6 or catch the bootleg whenever

Juggle Chainsaws What happens when a college kid gets the bright idea to write
waffles is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-17-2007, 08:16 PM   #6 (permalink)
Inactive
 
Join Date: 06-17-07
Posts: 6
iTrader: 0 / 0%
Latest Blog:
None

bomy is liked by many
I wish

They are not on an apache server.

They have Windows IIS so you cannot use the htaccess file. The code that I mentioned regarding the www. vs non www addresses was to be saved as a file named redirect.asp and then added to the top of each file on the site with the following snippet:

<!-- #Include file="redirect.asp" -->

Does this make sense to you? The platform is template style. I do have access to the template html files but not the .asp files.

I hope this all makes sense. When I asked the host for a fix a few months ago they said this "disallow" would work - Not! I am not even sure where they put it. Doesn't show at all from my side (ie robot's text file).

Thanks
bomy is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-18-2007, 09:25 AM   #7 (permalink)
Empress™
 
chicgeek's Avatar
 
Join Date: 08-19-04
Location: York, UK
Posts: 17,988
iTrader: 0 / 0%
Latest Blog:
My Favourite Poem

chicgeek is a web professional of the highest orderchicgeek is a web professional of the highest orderchicgeek is a web professional of the highest orderchicgeek is a web professional of the highest orderchicgeek is a web professional of the highest orderchicgeek is a web professional of the highest orderchicgeek is a web professional of the highest orderchicgeek is a web professional of the highest orderchicgeek is a web professional of the highest orderchicgeek is a web professional of the highest orderchicgeek is a web professional of the highest order
I think this belongs more in coding than ASP, but correct me if I'm mistaken.
__________________
laura / chicgeek
soprano & web designer
laurakishimoto.ca
chıcgeeĸ @ flickr
chicgeek is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-18-2007, 10:20 AM   #8 (permalink)
v7n Mentor
 
Costin Trifan's Avatar
 
Join Date: 04-13-07
Location: Romania
Posts: 2,909
iTrader: 0 / 0%
Costin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web pro
Hey, bomy ! Welcome to the forums!

well, this is your code:

Code:
Protected Overrides Sub OnLoad(ByVal e As System.EventArgs) MyBase.OnLoad(e) Response.Status = "301 Moved Permanently" Response.AddHeader("Location", "http://where-to-redirect") Response.End() End Sub
"http://where-to-redirect = add the url where you want uer to be redirected

hope this helps you.

__________________
JUNE - JavaScript Framework
Costin Trifan is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-18-2007, 03:20 PM   #9 (permalink)
Inactive
 
Join Date: 06-17-07
Posts: 6
iTrader: 0 / 0%
Latest Blog:
None

bomy is liked by many
Thanks for the code. It looks like it is for a single page. Does this go at the top of the html pages? I only have access to the html frame, home, category, product pages etc. This is an ecommerce template style platform.

Will this redirect the host pages

http://www.myname.host name.com

to http://www.myname.com?

Will the www.myname.com pages be affected?

Sorry for so many questions?

Thanks

Bomy
bomy is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-18-2007, 03:22 PM   #10 (permalink)
Inactive
 
Join Date: 06-17-07
Posts: 6
iTrader: 0 / 0%
Latest Blog:
None

bomy is liked by many
I also have access of course to the root directory and css file. We just can get into the asp pages.

Thanks
bomy is offline  
Add Post to del.icio.us
Reply With Quote
Old 06-19-2007, 02:05 AM   #11 (permalink)
v7n Mentor
 
Costin Trifan's Avatar
 
Join Date: 04-13-07
Location: Romania
Posts: 2,909
iTrader: 0 / 0%
Costin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web pro
Quote:
Thanks for the code. It looks like it is for a single page. Does this go at the top of the html pages? I only have access to the html frame, home, category, product pages etc. This is an ecommerce template style platform.

Will this redirect the host pages

http://www.myname.host name.com

to http://www.myname.com?

Will the www.myname.com pages be affected?
1. I don't know what you mean here ( at the top of html pages )

2. Add this code to your index page from the http://www.myname.host name.com:
Code:
Protected Overrides Sub OnLoad(ByVal e As System.EventArgs) MyBase.OnLoad(e) Response.Status = "301 Moved Permanently" Response.AddHeader("Location", "http://www.myname.com/") Response.End() End Sub
This way the user will be redirected to http://www.myname.com every time he/she access the index page from http://www.myname.host name.com.
Costin Trifan is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mod Rewrite Help...please DM_Web _Directory Coding Forum 16 04-11-2007 06:43 PM
How to do rewrite like v7n Antonio Coding Forum 3 04-01-2006 04:19 AM
need help with mod rewrite url rewrite sim Coding Forum 3 07-31-2005 06:51 PM
Mod Rewrite T-Kai Coding Forum 5 08-24-2004 10:42 PM
php rewrite? LazyJim Coding Forum 8 04-01-2004 03:37 AM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 05:28 AM.
© Copyright 2008 V7 Inc