Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Feb 2008
    Posts
    97
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Capitals in web folder's name

    Hi all,

    I want to write in my browser:

    http://www.mywebpage.com/myfolder
    or
    http://www.mywebpage.com/Myfolder

    or any combination of capital and low case letters in the word myfolder.

    Right now, myfolder in my web server is written all low case, and if I try to write the address with a capital letter in the word myfolder the browser shows a not found error.

    How can I solve this??

    Thanks in advance!

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,538
    Thanks
    8
    Thanked 1,093 Times in 1,084 Posts
    ONLY use small letters for your directories (folders) ...

    Then, use .htaccess to convert any Capital letters to small,
    so people could type whatever they wanted, and the folder
    would open properly.

    Example:
    myfolder

    People could enter: Myfolder, MyFolder, MYFOLDER, etc.
    It would not matter.
    But the REAL folder is all small letters only.

    Here's the .htaccess part:
    RewriteEngine on
    RewriteMap upper2lower int:tolower
    RewriteRule ^/(.*)$ /${upper2lower:$1}

    EDIT:
    More examples:
    RewriteRule ^([^A-Z]*[A-Z].*)$ http://www.yoursite.com/${lowercase:$1} [R=301,L]

    but under condition that your httpd.conf has lowercase function enabled: RewriteMap lowercase int:tolower


    Use Google to search for other .htaccess tutorials.
    Last edited by mlseim; 03-31-2008 at 04:31 PM.

  • #3
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,280
    Thanks
    4
    Thanked 83 Times in 82 Posts
    The above post assumes your server is running Apache web server. If you are running a Windows server with IIS the above post will not apply.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster


  •  

    Posting Permissions

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