no file extensions using the .htaccess

Discussion in 'Apache' started by richieg100, Jan 11, 2006.

  1. #1
    I've been trying to figure this out and I can't seem to get it:
    I want to alter the .htaccess so that one can type in www.mysite.com/dir/file and get www.mysite.com/dir/file.php

    The problem is I keep getting a 500 everytime I upload the .htaccess. I'm getting all confused with the <directory> stuff. Could someone please help me out?

    Thanks alot,
    Richie

    P.S. I need it so that the sever knows to parse each page for PHP and SHTML regardless of what the extension is. (I know how to do this via .htaccess, but I'm not sure if doing the file extension thing alters how this needs to be done)
     
    richieg100, Jan 11, 2006 IP
  2. nevetS

    nevetS Evolving Dragon

    Messages:
    2,544
    Likes Received:
    211
    Best Answers:
    0
    Trophy Points:
    135
    #2
    Take a look at your server error logs.

    It could be that your server does not support mod_rewrite, or it could be a syntax error in your .htaccess file. The error log will give you specifics as to what is wrong.
     
    nevetS, Jan 11, 2006 IP
  3. stuw

    stuw Peon

    Messages:
    702
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #3
    what do you have in your .htaccess file?

    I would try:
    RewriteEngine On
    RewriteRule ^(.*)/(.*)/ /$1/$2.php
     
    stuw, Jan 11, 2006 IP
  4. richieg100

    richieg100 Peon

    Messages:
    17
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    as of now my .htaccess file is completely blank. My server supports everything. The problem is definatly with the actual code i was writing.

    Can somone type out the code real quick? I'm sure it's not more than a few lines. And, of course, the links to files dont have can be something like /site/dir/

    Thanks alot!
     
    richieg100, Jan 13, 2006 IP