This is my first time trying to write htaccess rules. My target is to make all relative links to be redirected to absolute. To begin i was testing:
RewriteEngine On
RewriteRule gallery\.php$ http://www.domain.com/sample/gallery.php
RewriteRule info\.php$ http://www.domain.com/sample/gallery.php
The first rule makes Firefox throw the error "The page isn't redirecting properly" when I click on the link, while the second rule works fine. The idea for the future was to write a rule like,
RewriteRule catchAllRelativeLinks$ http: //www.domain.com/sample/$1
but if I can't make the first rule work I don't think I will find how to make the real rule.
EDIT: to avoid the endless loop can't i try to understand if i am on the first or second istance by catching a variable ? some ideas i tried (and faild):
RewriteCond %{IS_SUBREQ} false
RewriteRule ^gallery\.php$ http://www.domain.com/gallery.php?a [R=302,L]
RewriteCond %{THE_REQUEST} !(\?something)$
RewriteRule ^gallery\.php$ http://www.domain.com/gallery.php?something [R=302,L]
or with an environment variable,
thanks again