Solved

htaccess change url to lowercase using RewriteMap

Posted on 2010-08-18
2
1,321 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
Comment Utility
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
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

763 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now