uppercase to lowercase url's

Please support our Search Engine Optimization advertiser: Get a Free SEO Analysis!
Reply

Join Date: May 2006
Posts: 3
Reputation: dedoo is an unknown quantity at this point 
Solved Threads: 0
dedoo dedoo is offline Offline
Newbie Poster

uppercase to lowercase url's

 
0
  #1
May 29th, 2006
Hi all,

newbie question here...

Is there a simple solution to rewrite my urls with capital letters to all lowercase?

i.e.

www.url.com/Test.html

to

www.url.com/test.html

I'm building a directory and the url's are rewritten but keep the uppercase letters right now. I would like to change that to all lowercase.

can this be done with a mod rewrite rule? what should I add to my .htaccess file to make it work?

Thanks
DD
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 89
Reputation: msaqib is an unknown quantity at this point 
Solved Threads: 1
msaqib msaqib is offline Offline
Junior Poster in Training

Re: uppercase to lowercase url's

 
0
  #2
May 30th, 2006
RewriteEngine on 
RewriteMap upper2lower int:tolower 
RewriteRule ^/(.*)$ /${upper2lower:$1}

Amnot sure if it will work or not. You can read the full post here...
http://balajin.net/blog/archives/200...convert_u.html
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 3
Reputation: dedoo is an unknown quantity at this point 
Solved Threads: 0
dedoo dedoo is offline Offline
Newbie Poster

Re: uppercase to lowercase url's

 
0
  #3
May 30th, 2006
Originally Posted by msaqib
RewriteEngine on 
RewriteMap upper2lower int:tolower 
RewriteRule ^/(.*)$ /${upper2lower:$1}
Amnot sure if it will work or not. You can read the full post here...
http://balajin.net/blog/archives/200...convert_u.html
I am getting a 500 error when I add this to my .htaccess file

# Protect files
<Files ~ "^(.*)\.(inc|inc\.php|tpl|sql)$">
  Order deny,allow
  Deny from all
</Files>

# Protect directories
<Files ~ "^(backup|files|images|include|lang|libs(/.+)?|temp(/.+)?|templates(/.+)?|javascripts(/.+)?)$">
  Order deny,allow
  Deny from all
</Files>

# Disable directory browsing
Options -Indexes

# Follow symbolic links in this directory
Options +FollowSymLinks

# Override PHP settings that cannot be changed at runtime
# (If your server supports PHP settings via htaccess you can comment following two lines off)
# php_value register_globals   0
# php_value session.auto_start 0

# Customized error messages
# ( If you are running in a subfolder please add it, example: "directory/index.php?httpstatus=404" )
ErrorDocument 404 index.php?httpstatus=404

# Set the default handler
DirectoryIndex index.php

# URL rewrite rules
<IfModule mod_rewrite.c>
   
   RewriteEngine On
   
   ## Details Link Page Rewrite##
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule (.*)fishing/link-(.*).html$ detail.php [QSA,NC]

   ## Pagination Rewrite
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule (.*)page-(\d+)\.html$  $1/?p=$2 [PT,NC]

   ## Category redirect
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule ^(.*)$ index.php [QSA,L]

</IfModule>
any idea where and how I should add this?
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 25
Reputation: guybrush is an unknown quantity at this point 
Solved Threads: 0
guybrush guybrush is offline Offline
Light Poster

Re: uppercase to lowercase url's

 
0
  #4
Jun 5th, 2006
case is not a factor considered by search engines in rating websites. Its more of a site usibility issue than a SEO one.
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 96
Reputation: newonlineinfo is an unknown quantity at this point 
Solved Threads: 0
newonlineinfo newonlineinfo is offline Offline
Junior Poster in Training

Re: uppercase to lowercase url's

 
0
  #5
Jul 12th, 2006
Originally Posted by dedoo
Hi all,

newbie question here...

Is there a simple solution to rewrite my urls with capital letters to all lowercase?

i.e.

www.url.com/Test.html

to

www.url.com/test.html

I'm building a directory and the url's are rewritten but keep the uppercase letters right now. I would like to change that to all lowercase.

can this be done with a mod rewrite rule? what should I add to my .htaccess file to make it work?

Thanks
DD
Hi,

Why you want this to be done? For SEs? :!:
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 12,040
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 126
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is online now Online
The Queen of DaniWeb

Re: uppercase to lowercase url's

 
0
  #6
Jul 12th, 2006
Aside from the SEs, my guess would be to accomidate for typos. Or ... because he used to use capital letters and now he wants to use all lowercase because it's easier to type in and such, and he doesn't want the old URLs to be broken.
Dani the Computer Science Gal
Follow my Twitter feed! twitter.com/daniweb
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 96
Reputation: newonlineinfo is an unknown quantity at this point 
Solved Threads: 0
newonlineinfo newonlineinfo is offline Offline
Junior Poster in Training

Re: uppercase to lowercase url's

 
0
  #7
Jul 12th, 2006
Originally Posted by cscgal
Aside from the SEs, my guess would be to accomidate for typos. Or ... because he used to use capital letters and now he wants to use all lowercase because it's easier to type in and such, and he doesn't want the old URLs to be broken.
Hi,

Both http://www.asdf.com/ASD.php and http://www.asdf.com/asd.php is equal So no borken URLs :mrgreen:
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 1
Reputation: rijas_mk is an unknown quantity at this point 
Solved Threads: 0
rijas_mk rijas_mk is offline Offline
Newbie Poster

Re: uppercase to lowercase url's

 
0
  #8
May 7th, 2009
Originally Posted by msaqib View Post
RewriteEngine on 
RewriteMap upper2lower int:tolower 
RewriteRule ^/(.*)$ /${upper2lower:$1}

Amnot sure if it will work or not. You can read the full post here...
http://balajin.net/blog/archives/200...convert_u.html
You are almost correct, but you have to place the code in httpd.conf and not in the .htaccess (Internal server error will occure)

You can place the code as follows in httpd.conf
<virtualhost.....
<bunch of host stuff>

RewriteEngine on
RewriteMap lowercase int:tolower
RewriteCond $1 [A-Z]
RewriteRule ^/(.*)$ /${lowercase:$1} [R=301,L]

</VirtualHost>

Please check
http://httpd.apache.org/docs/1.3/mod...ml#InternalAPI
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC