NetTalk Central
Toggle navigation
Login
Register
×
Welcome,Guest
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
NetTalk Central
»
NetTalk Web Server
»
Web Server - Ask For Help
»
How to do a 301 Redirect from "www" to "root"?
« previous
next »
Print
Pages: [
1
]
Author
Topic: How to do a 301 Redirect from "www" to "root"? (Read 3922 times)
Stu
Hero Member
Posts: 510
How to do a 301 Redirect from "www" to "root"?
«
on:
December 07, 2016, 02:52:24 PM »
Hi Bruce/Folks,
Specific question (arising out of another post below).
What's the best way to do a 301 Redirect for "www" urls pushing them to the "root" (non-www) urls?
(
https://support.google.com/webmasters/answer/93633
)
I've gone through the webhandler embeds that I do use for redirecting and doing lots of magic stuff. But am not sure of the right place to be able to adjust the "www".
Cheers.
Logged
Cheers,
Stu Andrews
Bruce
Global Moderator
Hero Member
Posts: 11244
Re: How to do a 301 Redirect from "www" to "root"?
«
Reply #1 on:
December 12, 2016, 02:12:14 AM »
so the call is
p_web.Redirect(toURL)
I think the best place for it is in WebHandler, _SendFile, after loc:filename is set...
something along the lines of
if lower(sub(loc:filename,1,3)) = 'www'
self.redirect....
return
end
cheers
Bruce
Logged
Stu
Hero Member
Posts: 510
Re: How to do a 301 Redirect from "www" to "root"?
«
Reply #2 on:
December 13, 2016, 01:46:53 PM »
Thanks Bruce, really appreciate this.
What's cool is that the solving of the relative urls issue (other thread) meant this no longer was something that needed to happen. Thankfully.
But is a great piece of info/how-to to have on the forum.
Cheers.
Stu
Logged
Cheers,
Stu Andrews
Print
Pages: [
1
]
« previous
next »
NetTalk Central
»
NetTalk Web Server
»
Web Server - Ask For Help
»
How to do a 301 Redirect from "www" to "root"?