Results 1 to 3 of 3

Thread: mod_rewrite

  1. #1
    Draw the Drapes Recognized Member rubah's Avatar
    Join Date
    Dec 2004
    Location
    Now Destiny is done.
    Posts
    30,655
    Blog Entries
    21
    Contributions
    • Former Administrator
    • Former Cid's Knight

    Default mod_rewrite

    Code:
    RewriteRule http://snowy-day.net http://www.snowy-day.net/ [R=301]
    RewriteRule http://snowy-day.net/(.*)? http://www.snowy-day.net/($1) [R=301]
    My goal is to force the www. on all URLs on my site and the trailing slash on the domain level. This is obviously not a good way to do it, nor a correct one, as it doesn't work. What do I do instead?

    More questions to follow at some point if I get to the point where I have some terribly ugly php-made urls.

  2. #2
    Last Exile Baloki's Avatar
    Join Date
    Sep 2003
    Location
    Dreaming a dream~
    Posts
    8,425
    Articles
    5
    Blog Entries
    2

    FFXIV Character

    Baloki Kyuu (Sargatanas)
    Contributions
    • Former Senior Site Staff

    Default

    I'd probably use some If Statements pulled in with a PHPInclude that force each page to check and alter the url?
    FOA

  3. #3
    Draw the Drapes Recognized Member rubah's Avatar
    Join Date
    Dec 2004
    Location
    Now Destiny is done.
    Posts
    30,655
    Blog Entries
    21
    Contributions
    • Former Administrator
    • Former Cid's Knight

    Default

    Jason showed me the light:
    Code:
    RewriteCond %{HTTP_HOST} ^snowy-day.net [NC]
    RewriteRule ^(.*)$ http://www.snowy-day.net/$1 [R=301]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •