Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Session vars in domain.com and www.domain.com

Status
Not open for further replies.

minli98

IS-IT--Management
Aug 30, 2005
178
US
Hi,

I have set up my ssl as However if the user starts from and is transferred to the ssl page, the session vars cannot be read as they belong to the
Doesn't seem to be a problem in explorer, but certainly a problem in firefox (and maybe netscape).

Short of forcing users to use (i.e. if they type in they will be routed to mydomain.com/abc.htm), is there a better way so that the session vars from can be read by mydomain.com?

Many thanks.

Regards,
Min
 
Hi GUJUm0deL,

Unfortunately some of the vars are for shopping cart and transaction/user-specific info so I probably can't use application vars.

Min
 
it's bad SEO practice to use and Force guests to one or the other.

Plus unless you have a wildcard SSL your SSL Cert. would normally be purchased as name or name, this would cause users to have to click ok to accept certs.

Here's an example - include this in your sites application file.

<!--- 301 REDIRECTION TO THE CORRECT DOMAIN NAME - --->
<cfif NOT #CGI.SERVER_NAME# IS " <CFHEADER STATUSCODE="301" STATUSTEXT="Moved permanently">
<CFIF Right(CGI.SCRIPT_NAME,11) IS "default.cfm">
<CFSET strNewURL=" <CFELSE>
<CFSET strNewURL=" </CFIF>
<CFIF #CGI.QUERY_STRING# NEQ "">
<CFSET strNewURL="#strNewURL#?#CGI.QUERY_STRING#">
</CFIF>
<CFHEADER NAME="Location" VALUE="#strNewURL#">
</cfif>
 
Thanks ksea. I did not know that search engines actually prefer just one or the other. I have followed your 301 redirection. Thanks for the advice.

Min
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top