htaccess rewrite question..

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • poe
    Confirmed User
    • Mar 2004
    • 455

    #1

    htaccess rewrite question..

    i have a site with a bunch of php files like this:

    http://www.site.com/cookies.php
    http://www.site.com/milk.php

    is it possible to make a rewrite so the links would look like this?

    http://www.site.com/cookies
    http://www.site.com/milk

    thanks a bunch
  • SmokeyTheBear
    ►SouthOfHeaven
    • Jun 2004
    • 28609

    #2
    http://www.sitepoint.com/article/sea...riendly-urls/3
    hatisblack at yahoo.com

    Comment

    • Bro Media - BANNED FOR LIFE
      MOBILE PORN: IMOBILEPORN
      • Jan 2004
      • 16502

      #3
      RewriteRule ^/([^/]+)*$ $1.php

      that should work, but don't make any .php files that have folders with the same name or it will fuck with it

      Comment

      • poe
        Confirmed User
        • Mar 2004
        • 455

        #4
        hmm, thanks for the help guys.

        somehow i can't get it to work.

        should my htaccess file have more than this:

        RewriteEngine on
        RewriteRule ^/([^/]+)*$ $1.php

        ?

        Comment

        • Bro Media - BANNED FOR LIFE
          MOBILE PORN: IMOBILEPORN
          • Jan 2004
          • 16502

          #5
          Originally posted by poe
          hmm, thanks for the help guys.

          somehow i can't get it to work.

          should my htaccess file have more than this:

          RewriteEngine on
          RewriteRule ^/([^/]+)*$ $1.php

          ?
          yes

          8chars....

          Comment

          • poe
            Confirmed User
            • Mar 2004
            • 455

            #6
            RewriteEngine On
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule ^(.*)$ $1.php [L,QSA]

            that worked. thanks!

            Comment

            Working...