Redirects http://domain to http://www.domain
Please support our JavaScript / DHTML / AJAX advertiser: Programming Forums
![]() |
•
•
Posts: 31
Reputation:
Solved Threads: 0
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.
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.
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)
<script type="text/javascript"> <!-- /* To ensure that it will be loaded with appropriate ext. */ window.onload = function() { window.location = 'http://www.yourdomain.com'; } //--> </script>
![]() |
Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
- IE7 Browser Redirects (Viruses, Spyware and other Nasties)
- cloaking (Search Engine Optimization)
- Redirecting a Directory or page... (Linux Servers and Apache)
- This Should be Easy for You Guys! (Linux Servers and Apache)
- Compiling Programs (C++)
- another newbie with alot of redhat and apache server Q'S (Linux Servers and Apache)
- Pr and redirects (Search Engine Optimization)
- Computer extremely slow - can you please help tell me what's wrong? (Viruses, Spyware and other Nasties)
- Radical Vision, LLC - 2 Months Free - 4 GB Disk Space / 45GB BW / Unlim. Domains (Web Hosting Deals)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: tooltip style popup
- Next Thread: Dynamic Table Creation
•
•
•
•
Views: 414 | Replies: 3 | Currently Viewing: 1 (0 members and 1 guests)





Linear Mode