Solved

htaccess change url to lowercase using RewriteMap

Posted on 2010-08-18
2
1,356 Views
Last Modified: 2012-05-10
I would like the below code to convert the new url to lowercase,

I have found some examples, but can't seem to get it to work.
http://balajin.net/blog/archives/2005/10/07/using_mod_rewrite_to_convert_u.html
RewriteCond %{QUERY_STRING} ^param=([a-zA-Z0-9_-]*)$
RewriteRule ^index\.php$ /ff/%1? [R,L]

Open in new window

0
Comment
Question by:thydzik
2 Comments
 
LVL 2

Assisted Solution

by:geoffkendal
geoffkendal earned 250 total points
ID: 33464279
i found this...

rewriteEngine on
rewriteMap lowercase int:tolower
rewriteCond $1 [A-Z]
rewriteRule ^/(.*)$ /${lowercase:$1} [R=301,L]
0
 
LVL 30

Accepted Solution

by:
Brad Howe earned 250 total points
ID: 33471131
Hi,
RewriteEngine On
RewriteMap  lc int:tolower
RewriteCond %{REQUEST_URI} [A-Z]
RewriteRule (.*) ${lc:$1} [R=301,L]

Note that the RewriteMap directive can only be used in the httpd.conf and not in a .htaccess.
Cheers,
Hades666
 
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question