• thomasmaas

    (@thomasmaas)


    The following list of items would imho improve the currently generated htacces file and drop the number of posts on this subject:

    • add structure and comments to rules: group rules give them a #title that explains their function etcetara
    • order rules from specific to general: put the category rule at the bottom to prevent (future) trouble (RewriteRule ^archives/?(.*) /index.php?category_name=$1 [QSA]
      should be at the bottom
    • warn against giving the category and archives path the same “start folder” (i.e. both of them ‘archives’ and if not, let htacces generator delete the first ‘?’ in the archives rule when the same names are given. ( RewriteRule ^archives/([0-9]{4})<delete?/>/?([0-9]{1,2})?/?([0-9]{1,2})?/?([_0-9a-z-]+)?/?$ /index.php?year=$1&monthnum=$2&day=$3&name=$4 [QSA]note that for equal folder names to work correctly item 1 of this list is also required otherwise all requests are taken by the more general category rule
    • add the following flags to all rules: [QSA,NC,L]
      [NC] for accidenly caps lock entered URI’s but more important [L] to stop htaccess being executed when the corresponding rule has been found and thus speeding things up. (or is this function alreadly built in the [QSA] flag?)
    • (not directly htaccess related)
      put the default category path (‘/categories/’ I believe it is) in the options/permalinks category path textbox so people can delete it and create a structure like http://www.domain.com/categoryname/. In other words: power the user to overwrite the path with pure nothingness
    • list addicts live longer

Viewing 7 replies - 1 through 7 (of 7 total)
  • MaxT

    (@maxt)

    categories in htaccess are bad idea imho… people add/remove categories all the time, and posts are moved from 1 category to another. It’ll lead to lot of 404 @ searchengines I think.

    Anonymous

    Thomas, email Matt (http://photomatt.net/) on this .

    Thread Starter thomasmaas

    (@thomasmaas)

    Hi Matt,
    Anonymous told me to e-mail you so everything’s cool..:-)
    but maybe I should. Just a bit of fear that there’s a big bug in my thoughts. I would like some more feedback before ringing at Mr. programmer’s door.

    junesix

    (@junesix)

    Reading this thread got me thinking… isn’t the additional /archives/ essentially cruft in itself? I know I’m probably opening a can of worms on this one.
    If a front page is http://yourdomain.com then http://yourdomain.com/year/month/ and http://yourdomain.com/category/ should imply archive pages. It just seems like the additional /archives/ directory doesn’t do much besides lengthen the URIs. For me, this makes even more sense as my “static” pages like About and Photos aren’t really static pages but actually archive pages using custom templates.

    Thread Starter thomasmaas

    (@thomasmaas)

    There’s one but: if you want to have a page with an overview of your archives, most logically this would be http://www.domain.com/archives/. Then a page within this archive would logically be something like http://www.domain.com/archives/2004/05/ that is, if you see your site as a tree structure.
    Where I do see your point: categories. Normally categories are part of your navigation so you don’t need a page like http://www.domain.com/categories/ to list all your categories because they are alreadly listed on, let’s say, every page. Therefore, http://www.domain.com/categoryname/ seems much cleaner than http://www.domain.com/categories/categoryname/
    In the end it’s a personal thing I guess.

    charle97

    (@charle97)

    junesix,
    run a site with mt and then you’ll find out the necessity of the archives directory.

    johne59

    (@johne59)

    Since .htaccess and mod-rewrite don’t work on an IIS server, I’d like to know if there’s any other avenue to modify the permalinks structure on IIS ?

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘htaccess improvement list’ is closed to new replies.