Redirect Wordpress URLs to Lowecase

Category: Wordpress

Preferred
Asked:
2013-10-21 9:32 am EST

Hits: 523
Hi, I'd like for domain.com/example and domain.com/EXAMPLE to point to the same file. I found a site that recommended adding the following to my .htaccess file:

RewriteEngine on
RewriteBase /
RewriteMap insensitive tolower:
RewriteRule ^[\/]*(.*)$ /${insensitive:$1} [R,L]

The problem is, my .htaccess file is not empty. I assume the following was added by WordPress:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Is it possible to combine the two so that the wordpress code continues to work, but the server treats all URLs as lowercase?

Many thanks!

You must login before you can ask a follow up question.

You must login before you can submit an answer.

OTHER ANSWERS

0

johnpaulb-imhs1
Staff
8,250 Points
2013-10-21 10:10 am EST
Hello Preferred,

Thank you for contacting us. There shouldn't be a problem with using both rules, as long as one rule is not interfering/contradicting the other. I also recommend grouping all the rewrite rules together.

There are also plugins available for accomplishing this in Wordpress, such as "Force Lowercase URLs."

For additional information on the .htaccess file, see our .htaccess file reference list .

If you have any further questions, feel free to post them below.
Thank you,

-John-Paul

You must login before you can post a comment about this answer.

Thanks John-Paul.

When I change my .htaccess file to read:


# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteMap insensitive tolower:
RewriteRule ^[\/]*(.*)$ /${insensitive:$1} [R,L]
</IfModule>



# END WordPress
it gives me an internal 500 error. What am I missing?
Preferred
8 Points
2013-10-21 11:14 am EST
Hello Preferred,

There shouldn't be any capitalized folders within the Wordpress directories, since Wordpress generates the pages dynamically.

Sorry, but I looked into this further and the only successful way I could find to accomplish this in Wordpress is via a plugin, such as the "Force Lowercase URLs," Case Insensitive Permalinks , or custom code a different solution.

If you have any further questions, feel free to post them below.
Thank you,

-John-Paul
johnpaulb-imhs1
8,250 Points
Staff
2013-10-21 1:23 pm EST
Like this Question?

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!