Qestion about htaccess

Discussion in 'Apache' started by mozgu, Jul 11, 2006.

  1. #1
    Hello guys.
    I have a problem:
    I want to hide extension of file in url.
    After entering in /cat/file i wanna show file.php but i want to have cat/file in url field /cat/file. How to do it in htaccess?

    Something like this: www.jor.pl/hosting - we see file hosting.html, but we have in url field (in our browser) jor.pl/hosting (the extension is hidden).

    Thanks for help
     
    mozgu, Jul 11, 2006 IP
  2. Glen

    Glen Peon

    Messages:
    1,852
    Likes Received:
    91
    Best Answers:
    0
    Trophy Points:
    0
    #2
    wont it do that naturally if you call the file index.html

    after all, if you wont see the extension then the "keyword" style url wouldnt help anyway, so index.html should/does work fine
     
    Glen, Jul 11, 2006 IP
  3. mozgu

    mozgu Member

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #3
    No, on my server it isn't work naturally (i don't want do do it with index.php only, but with all the files. Anybody knows how to do it in htaccess ? :|
     
    mozgu, Jul 11, 2006 IP
  4. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #4
    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    RewriteRule ^cat/([^.]+)$ cat/$1.html [L]
     
    Nintendo, Jul 11, 2006 IP
  5. mozgu

    mozgu Member

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #5
    Thank you very much :)
     
    mozgu, Jul 12, 2006 IP