1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How do I ignore case in urls?

Discussion in 'Apache' started by abigscot, Sep 9, 2009.

  1. #1
    Hi, I am running a joomla site on an apache server... on my site all my urls are lowercase but I know some people use uppercase when looking for my site. I even put uppercase in some marketing materials as I didn't know it was an issue.

    I was told there is a command I can use that will ignore the case of the url and point it to the right place.
    Can someone help with this please? I've looked around the forum and googled but haven't found a straightforward, simple answer on how to do this.

    Much appreciated

    David
     
    abigscot, Sep 9, 2009 IP
  2. atbnet

    atbnet Peon

    Messages:
    75
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can use mod rewrite to make this work for you.

    RewriteEngine On
    RewriteMap lowercase int:tolower
    RewriteRule ^(.*)$ ${lowercase:$1}
     
    atbnet, Sep 9, 2009 IP
  3. abigscot

    abigscot Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Do I just copy and paste this code into my .htaccess file? I have mod_rewrite code in there already.
    Is anything else required?

    Also, will this make the complete url lowercase? for example, will it make www.Compete.com/DIRECTORY become www.compete.com/directory ?

    thank you!
     
    abigscot, Sep 9, 2009 IP
  4. abigscot

    abigscot Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    well I answered my own question :)
    copying and pasting the code as it is into the .htaccess file does not work, it causes site to crash giving 500 Internal Server Error.

    Where should this code go?

    all the best
    David
     
    abigscot, Sep 10, 2009 IP
  5. atbnet

    atbnet Peon

    Messages:
    75
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    What is the error you are receiving?
     
    atbnet, Sep 10, 2009 IP
  6. oneawesomeguy

    oneawesomeguy Peon

    Messages:
    835
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #6
    "500 Internal Server Error"

    This is due to problems with your previous .htaccess code and this one conflicting. Can you post your other code here? We may be able to help you more in that situation.

    Also, you can just use the following code:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^domain.com
    RewriteRule (.*) http://www.domain.com/$1 [R=301,L]
    Code (markup):
    It will add a www in front of your domain and for my Apache server, automatically converts all uppercase URLs to lowercase ones.

    Hope that helps.
     
    oneawesomeguy, Sep 10, 2009 IP
  7. nettroll

    nettroll Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Today our technical support team gave me html-webhelp generated on Windows in RoboHelp with different case in filenames and links to files. So I've got huge broken links when uploaded it to webserver :) Tried to play with mod_rewrite and mod_speling - no luck.

    Solved this problem by creating fat32 partition in file and mounting it.

    
    dd if=/dev/zero bs=1024k count=500 of=fat-partition.dat
    /sbin/mkfs -t vfat fat-partition.dat
    mount -t vfat -o loop fat-partition.dat /path/to/files
    ln -s /path/to/files /path/to/document-root/ignore-case
    
    Code (markup):
    FollowSymLinks option must be set in Apache configuration for specified directory.
     
    nettroll, Oct 2, 2009 IP