Canonical Redirect with classic ASP shows site folder -
if pointed http://domain.com redirects http://www.domain.com/thesite/index.asp actual location. no matter page, appends actual folder path.
ive been using script canonical redirection, included in every page.
if instr(request.servervariables("server_name"),"www") = 0 response.status="301 moved permanently" response.addheader "location","http://www." &_ request.servervariables("http_host")&_ request.servervariables("script_name") end if
i have several sites in shared hosting, each in own folder.
how can prevent this?
thanx help
ok after further diggin' bumped solution. turns out iis7 had url redirection rules enabled, can accomplished through web.config, this
<configuration> <system.webserver> <rewrite> <rules> <rule name="redirect www" stopprocessing="true"> <match url=".*" /> <conditions> <add input="{http_host}" pattern="^yoursite.com$" /> </conditions> <action type="redirect" url="http://www.yoursite.com/{r:0}" redirecttype="permanent" /> </rule> </rules> </rewrite>
i overlooked before cause listed asp.net solution, not classic asp. there is, solved.
Comments
Post a Comment