|
|
#1 (permalink) |
|
Business Guru
Join Date: Dec 2003
Location: Near Inverness, Highlands, Scotland
Posts: 7,719
|
Questions about using .htaccess and mod_rewrite have come up a few times here, so I've written this piece:
http://www.platinax.co.uk/52-a-simple-default-htaccess/ and included a basic .htaccess file that should help those on linux servers: 1. Redirect users to use only the www form of their domain 2. Redirect error pages to the site index page You can find a version to edit yourself here: http://www.platinax.co.uk/downloads/simple-htaccess.txt Hope that helps.
__________________
SEO specialist |
|
|
|
|
|
#2 (permalink) |
|
Senior Member
Join Date: Mar 2005
Location: Bedfordshire
Posts: 155
|
Thanks Brian, I actually understood that article - I have read many over the last few months and they tended to over complicate the issue.
I do have one request, would it be possible for you to provide an example of the mod_rewrite when using a dynamic URL for an ecommerce site. I am sure that there are many out there that would benefit of having a quick tutorial.
|
|
|
|
|
|
#3 (permalink) |
|
Business Guru
Join Date: Dec 2003
Location: Near Inverness, Highlands, Scotland
Posts: 7,719
|
mod_rewrite on ecommerce sites tends to be a pretty specialist area, where the required solution tends to require customisation according to the software involved.
I really wouldn't be able to provide mod_rewrite rules for general dynamic links, because not only would it be impossible to apply to most instances, but also there is often a requirement to edit the files in the software in a custom manner as well. The basic stuff on .htaccess for redirects is about as complex as I can get myself - mod_rewrite for dynamic URLs really is very speciaist, so no wonder it looks complicated. I have someone who works for me in this area, but I really don't understand what he does - only that it works.
__________________
SEO specialist |
|
|
|
|
|
#4 (permalink) |
|
Member
Join Date: Jan 2006
Posts: 30
|
thnx for the .htaccess file !
i wanted to ask u, if u could explain the difference from you're version and this other version? They both work, but there is a difference in the code they use. i don't know mayby one i better then the other? thnx in advance |
|
|
|
|
|
#5 (permalink) |
|
Business Guru
Join Date: Dec 2003
Location: Near Inverness, Highlands, Scotland
Posts: 7,719
|
At a glance, it looks like the second directs all users to the non-www form of the site.
Certainly I know there are sites out there that prefer that, and there's nothing wrong with that. Personally I prefer the www-form simply because a lot of people can more easily make the association, and more likely to add www in their links. However, the key issue is that of consistency - keeping toone form or the other, and that's simply a matter of personal preference. Hope that helps.
__________________
SEO specialist |
|
|
|
|
|
#6 (permalink) |
|
Member
Join Date: Jan 2006
Posts: 30
|
Thnx for the quick reply
![]() If i would choose for the non-WWW what is the difference for me if they link to me with a www in their links. Even if the visitor gets redirect to the non-www it still holds the same value (for link-juice) in googles eyes, right? Both the htaccess-files redirect to the non-WWW form of the site. But they don't use the same code for it, i thought mayby one is better then the other (even the result is the same) thnx |
|
|
|
|
|
#7 (permalink) |
|
Business Guru
Join Date: Dec 2003
Location: Near Inverness, Highlands, Scotland
Posts: 7,719
|
Well, I'm afraid I wasn't able to look at the first file properly, as I'm on the laptop and I'm having problems with my text editor on it at present.
However, I was able to look at the second version fine, which indeed looks as if it should work to use the non-www form. Really, it's simply the case of using what works - if you find either code appears to do what's required and uses a 301 redirect, then I can't see any problem between choices. Hope that helps.
__________________
SEO specialist |
|
|
|
|
|
#9 (permalink) |
|
Business Guru
Join Date: Dec 2003
Location: Near Inverness, Highlands, Scotland
Posts: 7,719
|
Just to let you know I've updated this article - originally, I suggested full URLs when setting up redirects to error pages in .htaccess.
However, I've recently discovered that this can lead to the server returning 200 OK headers - in other words, telling search engines that the missing file is actually found - so they'll keep requesting it. It's important to use relative redirects in .htaccess for this purpose, so I've amended the article for that.
__________________
SEO specialist |
|
|
|
|
|
#10 (permalink) | |
|
Member
Join Date: Jan 2006
Posts: 30
|
hi Brain,
I just tested my server header Quote:
I'm using you're example http://www.platinax.co.uk/downloads/simple-htaccess.txt thnx inadance! |
|
|
|
|