WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-02-2007, 11:27 AM
Gert Leroy's Avatar
WebProWorld Pro
 

Join Date: Oct 2005
Location: Natal - Brasil
Posts: 212
Gert Leroy RepRank 0
Default 301 redirect won't work.. HELP !

So here i am again, on a windy day on the north-east coast of beautiful Brazil, a day on which windsurfers take out their smallest sails to court the waves.. unfortunately those very same waves broke my equipment some days ago.. and all i can do for now is try to configure this 301-redirect..

Life can be cruel.

PROBLEM:
www.vacationsbrazil.com points to www.mauriciotravels.com which is the main domain. According to the tool http://www.seoconsultants.com/tools/headers.asp this redirect is not a 301..

#1 Server Response: http://www.vacationsbrazil.com
HTTP Status Code: HTTP/1.1 200 OK
Date: Mon, 02 Apr 2007 15:13:17 GMT
Server: Apache
Cache-Control: no-store, no-cache, must-revalidate
Connection: close
Content-Type: text/html


So i thought, OK let's use a small ASP-script to make this a 301-redirect..

-----------------------------------------
Dim Domain, URL
Domain = Request.ServerVariables ("HTTP_HOST") ' Gets the domain name.
URL = Request.ServerVariables ("URL") ' Gets the current URL.

if (InStr (Domain, "vacationsbrazil") = 1) then

URL = "http://www.mauriciotravels.com" & URL ' Concatenates the URL to the domain

Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", URL
end if

-----------------------------------------

Right?

Unfortunately it doesn't work because "Domain" allready returns "www.mauriciotravels.com" when in the locationbar is still displayed www.vacationsbrazil.com


Can anyone help me out?
Thanx.
Reply With Quote
  #2 (permalink)  
Old 04-02-2007, 02:31 PM
Webnauts's Avatar
WebProWorld 1,000+ Club
 

Join Date: Aug 2003
Location: Worldwide
Posts: 7,399
Webnauts RepRank 3Webnauts RepRank 3
Default

Gert did you try this?

<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "http://www.mauriciotravels.com"
%>
Reply With Quote
  #3 (permalink)  
Old 04-02-2007, 08:04 PM
Gert Leroy's Avatar
WebProWorld Pro
 

Join Date: Oct 2005
Location: Natal - Brasil
Posts: 212
Gert Leroy RepRank 0
Default

hello Webnauts,
i'm not sure if you understood my problem right..

the problem is in the IF THEN ELSE condition.

Are you saying you would put this peace of code

<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "http://www.mauriciotravels.com"
%>


on top of the homepage without an IF THEN ELSE condition? This means the 301-redirect would be executed every time someone enters the homepage, regardless if it is vacationsbrazil.com or mauriciotravels.com ??
Reply With Quote
  #4 (permalink)  
Old 04-02-2007, 08:15 PM
Webnauts's Avatar
WebProWorld 1,000+ Club
 

Join Date: Aug 2003
Location: Worldwide
Posts: 7,399
Webnauts RepRank 3Webnauts RepRank 3
Default

Gert I do not do programming myself. Besides I have moved the thread to the Web Programming forum for better chances to get help. :)
Reply With Quote
  #5 (permalink)  
Old 04-02-2007, 08:24 PM
Webnauts's Avatar
WebProWorld 1,000+ Club
 

Join Date: Aug 2003
Location: Worldwide
Posts: 7,399
Webnauts RepRank 3Webnauts RepRank 3
Default

Quote:
Originally Posted by Gert Leroy
hello Webnauts,
i'm not sure if you understood my problem right..

the problem is in the IF THEN ELSE condition.

Are you saying you would put this peace of code

<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "http://www.mauriciotravels.com"
%>


on top of the homepage without an IF THEN ELSE condition? This means the 301-redirect would be executed every time someone enters the homepage, regardless if it is vacationsbrazil.com or mauriciotravels.com ??
So far I know, yes. Why don't you try it?

Check here: http://www.theorganicseo.com/seo_tip...p_windows.html
Reply With Quote
  #6 (permalink)  
Old 04-13-2007, 11:33 AM
Gert Leroy's Avatar
WebProWorld Pro
 

Join Date: Oct 2005
Location: Natal - Brasil
Posts: 212
Gert Leroy RepRank 0
Default

Quote:
Originally Posted by webnauts
So far I know, yes. Why don't you try it?
well, with a little bit of common sense every one can figure out quite easily that your solution won't work. In don't have to try it to get the proof.

Anyone else has a solution for my specific case? Both urls point to the same hostingpackage. Thanks
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: , , , ,



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


Search Engine Optimization by vBSEO 3.2.0