Redirects http://domain to http://www.domain

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: May 2008
Posts: 31
Reputation: Punkis448 is an unknown quantity at this point 
Solved Threads: 0
Punkis448 Punkis448 is offline Offline
Light Poster

Redirects http://domain to http://www.domain

 
0
  #1
Nov 18th, 2008
Hello all.

I have a problem with my site.
Well there are some times that when i click on a link from the recent activity I get my custom error 404 page.
This happens when the url is http://domain.com/.............
The problem is solved and i can get inside the link when I add the www

Also, when I log in having http://www.domain all the links are having www.
When I remove the www , it shows all the links not having the www.
If i logged in with www , and remove www it shows that I am not logged in!


The conclusion is : I guess the site is seperated into two, to the http://domain.com/............. and http://www.domain.com/.............

Maybe this is a server mistake, I do not know.

Please help me about this and tell me if there is a chance to edit the files and put a www in it.

Also is there any script that detects whether the user is visiting the site without the www and redirecting it to the www one ?

Thank you.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 954
Reputation: essential will become famous soon enough essential will become famous soon enough 
Solved Threads: 131
Featured Poster
essential's Avatar
essential essential is offline Offline
Posting Shark

Re: Redirects http://domain to http://www.domain

 
0
  #2
Nov 18th, 2008
You can do it this way... Simply insert this bits of code inside the head section of your default page...

  1. <script type="text/javascript">
  2. <!--
  3. /* To ensure that it will be loaded with appropriate ext. */
  4. window.onload = function()
  5. { window.location = 'http://www.yourdomain.com'; }
  6. //-->
  7. </script>
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 31
Reputation: Punkis448 is an unknown quantity at this point 
Solved Threads: 0
Punkis448 Punkis448 is offline Offline
Light Poster

Re: Redirects http://domain to http://www.domain

 
0
  #3
Nov 18th, 2008
thank you for your reply friend.

Will this redirect the web page, right?
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 954
Reputation: essential will become famous soon enough essential will become famous soon enough 
Solved Threads: 131
Featured Poster
essential's Avatar
essential essential is offline Offline
Posting Shark

Re: Redirects http://domain to http://www.domain

 
0
  #4
Nov 19th, 2008
Yeah, something like that. But same location wil take place. If this doesnt solved the issue, let me know...
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC