DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   JavaScript / DHTML / AJAX (http://www.daniweb.com/forums/forum117.html)
-   -   Redirects http://domain to http://www.domain (http://www.daniweb.com/forums/thread158163.html)

Punkis448 Nov 18th, 2008 8:35 pm
Redirects http://domain to http://www.domain
 
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.

essential Nov 18th, 2008 10:52 pm
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...

<script type="text/javascript">
<!--
/* To ensure that it will be loaded with appropriate ext. */
window.onload = function()
{ window.location = 'http://www.yourdomain.com'; }
//-->
</script>

Punkis448 Nov 18th, 2008 10:58 pm
Re: Redirects http://domain to http://www.domain
 
thank you for your reply friend.

Will this redirect the web page, right?

essential Nov 19th, 2008 12:58 am
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...


All times are GMT -4. The time now is 5:01 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC