• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

.htaccess infinite redirect loop

Community Beginner ,
Nov 06, 2015 Nov 06, 2015

Copy link to clipboard

Copied

I would like to redirect my pages in the following ways:

www.example.com/index.php?locale=it -> www.example.com/it

and I would like to access the same page when I type:

www.example.com/it

I wrote an htaccess file but it causes a redirect loop. Here is the file:

<IfModule mod_rewrite.c>

Options +FollowSymLinks

RewriteEngine On

RewriteBase /


#REWRITE RULES #---------------------

RewriteCond %{QUERY_STRING} ^locale=(it|en|fr|de|es)$

RewriteRule ^index\.cfm$ %1? [R=302,L]


RewriteCond %{REQUEST_URI} !^index\.cfm

RewriteRule ^(it|en|fr|de|es)/?$ index.cfm?locale=$1  

</IfModule>

Could you help me to resolve it? Thanks!!!

PS: server is ColdFusion + Apache 2.4.7

Views

271

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation
Resources
Documentation