Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 14 of 14

This is a discussion on Filename Extensions/mod_rewrite help? in the Open Discussion & Chit-chat forum
Hopefully someone here will know how this is done... I just spent hours researching with no luck. All the web servers in the past i've ...

  1. #1
    JPC Member
    Join Date
    Feb 2004
    Posts
    28

    Filename Extensions/mod_rewrite help?

    Hopefully someone here will know how this is done... I just spent hours researching with no luck. All the web servers in the past i've used didn't require file extensions unless there were multiple files of the same name. example:
    site.com/filename

    it first checks to see if filename is a folder, then it tries for filename.cgi, .pl, .html, .jpg, .gif, etc and pretty much filename.* before returning a 404. the best jaguarpc support could tell me is to try to do something with mod_rewrite to make it work on this site. But i'm having no luck at all at making this work. Does anyone know how all the other web servers make that work? It even works on my home computer web server, but i couldn't find anything in httpd.conf to explain it.

    thanks for any help!

    -dan

  2. #2
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Um... maybe it's just me, but I don't understand the question. Could you state it a different way?
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  3. #3
    JPC Member
    Join Date
    Feb 2004
    Posts
    28
    ok, in my example, if i put a file named filename.html in the top level of site.com. currently i need the url to be site.com/filename.html to access it, but all other servers i've worked with would accept site.com/filename to access it. Filename extensions aren't required (unless there's a folder, etc with the same name). Does that make sense now?

  4. #4
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Yes, I understand now. Hrm... well, I just tested it on my site, and you are correct. If I type "http://www.lenon.com/index" in the browser, it looks for a folder called "index" and it 404's. Interesting! I don't know why you would want to do this, but to each his own.

    I don't know the answer to this riddle, but I'm sure jason will be by in a few minutes, and he'll figure it out for you. He's the resident Google-meister.

    Good luck!
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  5. #5
    JPC Member
    Join Date
    Feb 2004
    Posts
    28
    I wouldn't use it for index files, but for other files i would if for no other reasons than shorter file names... which i type a hundred times a day (too many to bookmark them all so i just type them) and to type bumrock.com/links is faster than bumrock.com/links.html . The main reason I need it to work is for URL continuity when moving from my old site. Thanks for any help!

  6. #6
    JPC Member
    Join Date
    Feb 2004
    Posts
    28
    It was figured out! Someone in a different message board suggested:

    You want to turn on the MultiViews option.

    In your root web folder, you can add a file called .htaccess and put the following on one line:

    Options +MultiViews

    ----

    and that did it!

    -dan

  7. #7
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Originally posted by rkstar
    In your root web folder, you can add a file called .htaccess and put the following on one line:

    Options +MultiViews

    and that did it!
    .htaccess is a wonderful thing, isn't it? .htaccess is a webmaster's best friend. Mine was 17Kb the last time I looked...
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  8. #8
    Old Hillbilly Connie's Avatar
    Join Date
    Sep 2001
    Location
    Hills of Missouri
    Posts
    2,646
    rkstar,

    Thanks for the mod rewite. You may know this but if you have
    two files with different extensions it will only work with one of
    them.

    In my test case home.htm and home.php I could only access the
    home.php page without the file extension.

    Forum Moderators - Jag Staff

    Spam Whackers Blog - Dedicated to fighting Spam and providing General SEO Tips
    Organize your Kitchen or purchase Kitchen Accessories at Condells
    Ihelpyou Forum - Dedicated to "Best Practices" SEO

  9. #9
    JPC Member
    Join Date
    Feb 2004
    Posts
    28
    yep... i knew about that. can't quite remember the order of things it checks in, i know first it checks for a folder, then scripts, then html/txt, then graphics. haven't really checked beyond that, but its really not an issue to me :-)
    -dan

  10. #10
    Old Hillbilly Connie's Avatar
    Join Date
    Sep 2001
    Location
    Hills of Missouri
    Posts
    2,646
    Checks a .php before .htm. My interest is the same as yours so it works great
    for what I wanted if for. Thanks again for taking the time to find this.

    Forum Moderators - Jag Staff

    Spam Whackers Blog - Dedicated to fighting Spam and providing General SEO Tips
    Organize your Kitchen or purchase Kitchen Accessories at Condells
    Ihelpyou Forum - Dedicated to "Best Practices" SEO

  11. #11
    JPC Guru
    Join Date
    Jan 2004
    Location
    I'm right behind you....
    Posts
    389
    I've always seen it check for html before php. I have an intro redirect page in one of my forums. It's index.html that redirects instantly to index.php. All you have to do is type site.com/forum/ and it goes to index.html first (otherwise, there'd be no point to having one in there, lol).

  12. #12
    JPC Member
    Join Date
    Feb 2004
    Posts
    28
    i think what you're talking about galen is the DirectoryIndex directive, not the mutliviews. if you add the line

    DirectoryIndex index.php index.html

    to your .htaccess file, it will search for the php before the html. It's solely the order of those (or if they don't exist, the order they're in in the jaguarpc's httpd.conf file) that decide the search order of index files.

    And to think.. two days ago I had no idea how to use a .htaccess file! It's been a long 2 days. So yeah, if you want it to go to php first, just add that line to your .htaccess. Or actually... if you delete the index.html file, then it'll just skip that.

    -dan

  13. #13
    JPC Guru
    Join Date
    Jan 2004
    Location
    I'm right behind you....
    Posts
    389
    Ah, ok, I gotcha. I was having dumb moment there

  14. #14
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    Cool. I'm glad you were able to figure it out. .htaccess files are pretty powerful things. There's tons of configuration changes that you can make with them. I know how to do quite a bit with them myself, but I'm always discovering new things, and I've been doing this stuff for years.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

Bookmarks

Posting Permissions

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