943,954 Members | Top Members by Rank

Ad:
Nov 18th, 2008
0

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

Expand Post »
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.
Similar Threads
Reputation Points: 8
Solved Threads: 0
Light Poster
Punkis448 is offline Offline
31 posts
since May 2008
Nov 18th, 2008
0

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

You can do it this way... Simply insert this bits of code inside the head section of your default page...

javascript Syntax (Toggle Plain Text)
  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>
Featured Poster
Reputation Points: 114
Solved Threads: 138
Posting Shark
essential is offline Offline
973 posts
since Aug 2008
Nov 18th, 2008
0

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

thank you for your reply friend.

Will this redirect the web page, right?
Reputation Points: 8
Solved Threads: 0
Light Poster
Punkis448 is offline Offline
31 posts
since May 2008
Nov 19th, 2008
0

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

Yeah, something like that. But same location wil take place. If this doesnt solved the issue, let me know...
Featured Poster
Reputation Points: 114
Solved Threads: 138
Posting Shark
essential is offline Offline
973 posts
since Aug 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: tooltip style popup
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: Dynamic Table Creation





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC