Forum Moderators: phranque

Message Too Old, No Replies

301 redirects

They're driving me bonkers

         

buddhabaker

7:23 am on Oct 25, 2011 (gmt 0)

10+ Year Member



Hello everyone.
I'm a new member of this forum and a beginner at trying to sort out my url redirect problems since re-organising the site by renaming files and creating a new directory structure.

In the past I had mixed case file names, file names that included underscores and I think every possible bad practice. Consequently I have major re-direct problems.

Every time I search for simple htaccess solutions I find every one deeply embedded in complex code. Is there a book that I can buy that teaches an understanding of the syntax and structure and how it all sticks together? About how to use mod-rewrite, mod-overwrite, or whatever and so on, so that I can understand and solve my problems?

Many thanks in advance.

lucy24

8:29 am on Oct 25, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Well, you can always start at the top [httpd.apache.org]. But if you find a copy of "mod_rewrite for Dummies" I want to hear about it.

Learn one module at a time. (The ones* that deal with auto-indexing don't count ;))

Read any random page of threads in this Forum. When you start saying "I've heard that somewhere before", memorize it. It will probably be g1 saying something he has said so often, he's got a macro for it.

Do not mix mod_alias with mod_rewrite.

Start with the most specific redirects and move to the most general.

Put the [L] flag at the end of every rule, and [R=301] if it is a redirect.

Read up on Regular Expressions. Never, ever use (.*) at the beginning of a pattern.

I've forgotten a few, but that's a start :)


* Yes, that's modules, dual. One to make the index, and another one to place the order.