Skip to main content
Inspiring
November 6, 2015
Question

.htaccess infinite redirect loop

  • November 6, 2015
  • 0 replies
  • 365 views

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

This topic has been closed for replies.