| Posted in Website Programming » PHP - Thursday 3rd January 2008 at 8:23PM | |
|
Alex Joined July 2007 |
How could i make sure that if the user types in: __________________________________ |
- Subscribe to this
- Search this thread
- Rate this thread
Ensuring www. is in url
Replies (8)
| Replied - Thursday 3rd January 2008 at 8:42PM [Post Link] | |
|
Alec Joined April 2007 |
Create a notepad file, call it htaccess.txt.
In it, place: Place it in your websites root directory, and change it from "htaccess.txt" to ".htaccess". Upload it to your server. Job done. __________________________________ |
| Replied - Thursday 3rd January 2008 at 9:28PM [Post Link] | |
|
Alex Joined July 2007 |
Thanks SO much :D
I never thought of using htaccess, genius. __________________________________ |
| Replied - Friday 4th January 2008 at 12:33AM [Post Link] | |
|
Will Joined October 2005 |
Be advised that forcing www onto a URL without it is stupid.
1. It redirects the user. (+time) 2. It means they're browsing from a subdomain, which means one extra request. (+time; +processing) Just because Google does it doesn't mean it's right. __________________________________ |
| Replied - Friday 4th January 2008 at 9:43AM [Post Link] | |
|
Alec Joined April 2007 |
Not true.
For Google, www.avengex.com and avengex.com represent two separate URLs, but for you and me it could be the same thing. It is so because you can actually have two different websites on those URLs (one www and another non-www) — it rarely happens though. When Google finds two URLs seemingly having the same/duplicate content, it indexes the one it considers the most apt.This way it can easily miss the page you actually want it to find. It can bec aused easily by say an affiliate linking to http://avengex.com/forums/view/74/ instead of http://www.avengex.com/forums/view/74/.The duplicate content problem can significantly harm your search engine rankings. Fortunately, canonical redirection (explained above) can solve this problem. __________________________________ |
| Sponsored Link | |
| Replied - Friday 4th January 2008 at 11:38AM [Post Link] | |
|
Alex Joined July 2007 |
__________________________________ |
| Replied - Friday 4th January 2008 at 5:10PM [Post Link] | |
|
adam2z Joined October 2005 |
[QUOTE] Alec said (4th January @ 9:43am): and the seo industry harms my search results. fuck them.blah blah http://no-www.org/ __________________________________ |
| Replied - Saturday 5th January 2008 at 12:32AM [Post Link] | |
|
Alec Joined April 2007 |
Yes. But untill that is universal, it is simply ignorant to ignore it.
Besides, you can rewrite everything to remove the www. thus being part of your little clan, and adhearing to my point.__________________________________ |
| Replied - Wednesday 23rd April 2008 at 12:49AM [Post Link] | |
|
fedekun Joined April 2008 |
here its a crappy way of doing it with PHP
$abs_path = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];__________________________________ |