Printer Friendly Version Print this thread
Email this thread to a friend eMail this thread to a friend
Related Forum Posts
Featured Web Site Template

Hundreds More at Free Site Templates.com!

Web Site Partners
Sponsored Links
Jet City Software
 
Whos Here ?
Reflects user activity within the last 5 minutes
Member Message

SportsGuy
Staff
Joined: Aug 30, 2002
# Posts: 3597

View the profile for SportsGuy Send SportsGuy a private message

Posted: 03/24/2006 05:49 am
Edit Message Delete Message Reply to this message

OK, so one of my programmers whipped up the following code to use to try and get around the non-www to www issues.

Dim strURL As String = (Request.Url.ToString).ToLower
If InStr(strURL, "http://domain.com" ) Then
Response.Redirect("http://www.domain.com" +
Request.RawUrl)
ElseIf InStr(strURL, "http://domain2.com" ) Then
Response.Redirect("http://www.domain2.com" + Request.RawUrl)
End If


Now, since this is NOT using the 301 redirect protocol, I say it's a no go. But, in fairness to him, I said I'd ask others for input.

On this same topic, can we simply drop the 301 redirects, as a list, into the <head> data in the site's header?

Because we are not allowed access to the server to program the server to deal with this stuff, we're trying for creative ways of handing out the 301 instructions.

I know this route clutters up the code somewhat, but are there any real rules that state this is a problem? Heck, I'll take experiential advice from folks on this one...

If I can avoid getting a VP here to crap on our head sysadmin, I will. Meaning, if we can be creative when using our 301's and they'll still do the job properly and in an accepted manner by the engines, I'll take that option over p1ssing of someone who I may need more from later.

Push comes to shove, though, and coding on the server is THE only proper way to do this in Windows, I'll call in the favors and push for the access.

Had a suggestion to use a Linux server for just hosting an htaccess file to handle this, but that's a no-go, unfortunately...

Thanks gang,

Duane



Dinkar
Staff
Joined: Aug 12, 2001
# Posts: 4356

View the profile for Dinkar Send Dinkar a private message

Posted: 03/24/2006 06:52 am
Edit Message Delete Message Reply to this message

Try this:


Code: [copy]







SportsGuy
Staff
Joined: Aug 30, 2002
# Posts: 3597

View the profile for SportsGuy Send SportsGuy a private message

Posted: 03/24/2006 06:59 am
Edit Message Delete Message Reply to this message

Thanks Dinkar. I'll forward this on, though I'm not sure this is even the right wat to approach these redirects. Might it cause problems down the road if we need to 301 a specific page...?



Dinkar
Staff
Joined: Aug 12, 2001
# Posts: 4356

View the profile for Dinkar Send Dinkar a private message

Posted: 03/24/2006 10:09 am
Edit Message Delete Message Reply to this message

No, it won't create any problem. You can redirect any specific page using it. No problem at all.



SportsGuy
Staff
Joined: Aug 30, 2002
# Posts: 3597

View the profile for SportsGuy Send SportsGuy a private message

Posted: 03/24/2006 10:28 am
Edit Message Delete Message Reply to this message

Sweet - thanks. smile



g1smd
Staff
Joined: Jul 28, 2002
# Posts: 10288

View the profile for g1smd Send g1smd a private message

Posted: 03/24/2006 01:21 pm
Edit Message Delete Message Reply to this message

Your original code looked good except that it generates a 302 redirect. You must avoid that and use a 301 instead.

The revised addition sends a 301 status instead. Combining the two bits of code should give you what you need.



SportsGuy
Staff
Joined: Aug 30, 2002
# Posts: 3597

View the profile for SportsGuy Send SportsGuy a private message

Posted: 03/24/2006 03:50 pm
Edit Message Delete Message Reply to this message

Combining the two bits of code should give you what you need.


You mean it'll make a hammer so I can beat our sysadmin into submission? wink



Prowler
Staff
Joined: Aug 14, 2000
# Posts: 1752

View the profile for Prowler Send Prowler a private message

Posted: 03/24/2006 09:24 pm
Edit Message Delete Message Reply to this message

On the job of a sysadmin, it is a thankless job. Not many sysadmins, I admit, keep themselves abreast of the development in this area. But generally, with a gentle nudge and with a bit of tenacity you can get them to do what you want - eventually. You always have the option of dumping them - or the hosts if they don't perform. wink



SportsGuy
Staff
Joined: Aug 30, 2002
# Posts: 3597

View the profile for SportsGuy Send SportsGuy a private message

Posted: 03/25/2006 04:50 am
Edit Message Delete Message Reply to this message

In our case, we employ 5 sysadmins, and our hosting is done ourselves (we have 42 servers, 4 fibre optic lines split in pairs between our offices and where the servers are actually housed (different location).

We have approx. 160 employees on site and naturally, we all have PCs which need tending to.

I really shouldn't beat upon my head sysadmin like I do, but it's frustrating at times. He does a very good job of things and we tell him (and his team) that. Trouble is he's stubborn - and it's frsutrating...argh!

No matter, we WILL resolve this peacfully. smile And I WILL take him to lunch.


You are not permitted to post messages in this forum or topic, because of one or more of the following reasons:
  1. You have not yet logged in, or registered properly as a member
  2. You are a member, but no longer have posting rights.
  3. This is a private forum, for which you do not have permissions.

If you are a recent member, it's possible that you simply have not yet confirmed your account. Please check your email for a message entitled 'JimWorld Forums: Confirm Your Account' and follow the instructions contained within.

If you cannot find this message, click here to Re-Send it.

If you are still experiencing problem, please read the Login Assistance Article for some advice on what may be causing your login not to work properly.

Switch to Advanced Editor and ... Create a New Topic or Reply to this Thread

New posts Forum is locked
© 1995  ·  iWeb, Inc  ·  DBA JimWorld Productions