I have two URLs:
http://www.domain.com/catalogo
http://www.domain.com/catalogo/item1
My .htaccess
header looks like this currently:
<IfModule mod_rewrite.c>
Options +FollowSymLinks -Indexes -Multiviews
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^inicio$ index.php [L]
RewriteRule ^catalogo$ catalogo.php [L]
RewriteRule ^catalogo/(.+) catalogo.php/$1 [L]
RewriteRule ^empresa$ empresa.php [L]
RewriteRule ^contacto$ contacto.php [L]
</IfModule>
I load content into catalogo.php
this way:
$("#contenido_catalogo").load("ajax_catalogo.php", {slu: 'lets_say_item1'}, function(){});
The first URL is loaded successfuly, but appending /item1
to the URL makes catalogo.php
load recursively instead of ajax_catalogo.php
.
It seems that loading of ajax_catalogo.php
matches the second RewriteRule and creates the endless loop, but I have no idea how to avoid it.
How should I do it instead? Thank you.