Highlighted

.htaccess infinite redirect loop

Community Beginner ,
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

212

Likes

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

.htaccess infinite redirect loop

Community Beginner ,
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

213

Likes

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
Nov 06, 2015 0

Have something to add?

Join the conversation