Re: [users@httpd] Help with mod_rewrite

2023-05-09 Thread Marc Serra
For your information, seems now works adding this rules as the first rules ...

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/(gb|es|ca|fr)/ [NC]
RewriteRule . /  [R,L]



Missatge de Frank Gingras  del dia dj., 20 d’abr.
2023 a les 16:12:
>
> The best way to tackle this complex set of rules is to use your development 
> server, clone the directives, comment out everything and uncomment a few 
> rules at a time.
>
> While you do this, see if you still have a loop (test with curl, not a 
> browser), examine the log entries, and then uncomment another rule. Repeat 
> until the loop appears.
>
> If you have a specific question about one log entry, do ask it.
>
> On Thu, Apr 20, 2023 at 2:18 AM Marc Serra  wrote:
>>
>> Thank's for answer Frank,
>>
>> A simple https://www.domain.tld/gb/ query generates a thousand lines
>> log file (attached). I'm really lost, I dont' know what I'm looking
>> for in the log file.
>>
>>
>>
>> Missatge de Frank Gingras  del dia dc., 19 d’abr.
>> 2023 a les 20:19:
>> >
>> > I would start with the rewrite log in your development environment, if you 
>> > can't change the configuration on the live server.
>> >
>> > I would also look to replace this entire mess with a FallbackResource 
>> > directive.
>> >
>> > On Tue, Apr 18, 2023 at 6:32 AM Marc Serra  wrote:
>> >>
>> >> Hi,
>> >>
>> >> A few weeks ago we renewed our prestashop website.
>> >>
>> >> One of the new features is the support for multiple languages.
>> >>
>> >> A typical home URL are...
>> >> https://www.domain.tld/gb/ for english
>> >> https://www.domain.tld/es/ for spanish
>> >> etc.
>> >>
>> >> A typical product URL are...
>> >> https://www.domain.tld/gb/PRODUCT_CATEGORY_FRIENDLY_URL/PRODUCT_CODE-PRODUCT_URL_FRIENDLY_DESCRIPTION.html
>> >> for english
>> >> https://www.domain.tld/es/PRODUCT_CATEGORY_FRIENDLY_URL/PRODUCT_CODE-PRODUCT_URL_FRIENDLY_DESCRIPTION.html
>> >> for spanish
>> >> etc.
>> >>
>> >> Our old URL wasn't contain the language, for example:
>> >> https://www.domain.tld/.html for home
>> >> https://www.domain.tld/PRODUCT_CATEGORY_FRIENDLY_URL/PRODUCT_CODE-PRODUCT_URL_FRIENDLY_DESCRIPTION.html
>> >> for product
>> >> etc.
>> >>
>> >> I'm trying to save the old URL and move to our default language (gb
>> >> for example).
>> >>
>> >> For start, I added the following two lines at the beginning of the
>> >> htaccess file. I try to redirect any URL not starting with /gb/ to the
>> >> english home page instead of 404 page ...
>> >>
>> >> RewriteCond %{REQUEST_URI} !^/gb/
>> >> RewriteRule ^.*$ /gb/ [L]
>> >>
>> >> # Followed by the prestashop default rules ...
>> >>
>> >> RewriteRule . - [E=REWRITEBASE:/]
>> >> RewriteRule ^api(?:/(.*))?$
>> >> %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]
>> >>
>> >> # Images
>> >> RewriteCond %{HTTP_HOST} ^www.domain.tld$
>> >> RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$
>> >> %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L]
>> >> RewriteCond %{HTTP_HOST} ^www.domain.tld$
>> >> RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$
>> >> %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L]
>> >> RewriteCond %{HTTP_HOST} ^www.domain.tld$
>> >> RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$
>> >> %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L]
>> >> RewriteCond %{HTTP_HOST} ^www.domain.tld$
>> >> RewriteRule 
>> >> ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$
>> >> %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L]
>> >> RewriteCond %{HTTP_HOST} ^www.domain.tld$
>> >> RewriteRule 
>> >> ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$
>> >> %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L]
>> >> RewriteCond %{HTTP_HOST} ^www.domain.tld$
>> >> RewriteRule 
>> >> ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$
>> >> %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L]
>> >> RewriteCond %{HTTP_HOST} ^www.domain.tld$
>> >> RewriteRule 
>> >> ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$
>> >> %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg
>> >> [L]
>> >> RewriteCond %{HTTP_HOST} ^www.domain.tld$
>> >> RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$
>> >> %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L]
>> >> RewriteCond %{HTTP_HOST} ^www.domain.tld$
>> >> RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$
>> >> %{ENV:REWRITEBASE}img/c/$1$2.jpg [L]
>> >> # AlphaImageLoader for IE and fancybox
>> >> RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$
>> >> js/jquery/plugins/fancybox/images/$1.$2 [L]
>> >>
>> >> # Dispatcher
>> >> RewriteCond %{REQUEST_FILENAME} -s [OR]
>> >> RewriteCond %{REQUEST_FILENAME} -l [OR]
>> >> RewriteCond %{REQUEST_FILENAME} -d
>> >> RewriteRule ^.*$ - [NC,L]
>> >> RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L]
>> >>
>> >>
>> >>
>> >> But when I visit 

Re: [users@httpd] Help with mod_rewrite

2023-04-20 Thread Frank Gingras
The best way to tackle this complex set of rules is to use your development
server, clone the directives, comment out everything and uncomment a few
rules at a time.

While you do this, see if you still have a loop (test with curl, not a
browser), examine the log entries, and then uncomment another rule. Repeat
until the loop appears.

If you have a specific question about one log entry, do ask it.

On Thu, Apr 20, 2023 at 2:18 AM Marc Serra  wrote:

> Thank's for answer Frank,
>
> A simple https://www.domain.tld/gb/ query generates a thousand lines
> log file (attached). I'm really lost, I dont' know what I'm looking
> for in the log file.
>
>
>
> Missatge de Frank Gingras  del dia dc., 19 d’abr.
> 2023 a les 20:19:
> >
> > I would start with the rewrite log in your development environment, if
> you can't change the configuration on the live server.
> >
> > I would also look to replace this entire mess with a FallbackResource
> directive.
> >
> > On Tue, Apr 18, 2023 at 6:32 AM Marc Serra  wrote:
> >>
> >> Hi,
> >>
> >> A few weeks ago we renewed our prestashop website.
> >>
> >> One of the new features is the support for multiple languages.
> >>
> >> A typical home URL are...
> >> https://www.domain.tld/gb/ for english
> >> https://www.domain.tld/es/ for spanish
> >> etc.
> >>
> >> A typical product URL are...
> >>
> https://www.domain.tld/gb/PRODUCT_CATEGORY_FRIENDLY_URL/PRODUCT_CODE-PRODUCT_URL_FRIENDLY_DESCRIPTION.html
> >> for english
> >>
> https://www.domain.tld/es/PRODUCT_CATEGORY_FRIENDLY_URL/PRODUCT_CODE-PRODUCT_URL_FRIENDLY_DESCRIPTION.html
> >> for spanish
> >> etc.
> >>
> >> Our old URL wasn't contain the language, for example:
> >> https://www.domain.tld/.html for home
> >>
> https://www.domain.tld/PRODUCT_CATEGORY_FRIENDLY_URL/PRODUCT_CODE-PRODUCT_URL_FRIENDLY_DESCRIPTION.html
> >> for product
> >> etc.
> >>
> >> I'm trying to save the old URL and move to our default language (gb
> >> for example).
> >>
> >> For start, I added the following two lines at the beginning of the
> >> htaccess file. I try to redirect any URL not starting with /gb/ to the
> >> english home page instead of 404 page ...
> >>
> >> RewriteCond %{REQUEST_URI} !^/gb/
> >> RewriteRule ^.*$ /gb/ [L]
> >>
> >> # Followed by the prestashop default rules ...
> >>
> >> RewriteRule . - [E=REWRITEBASE:/]
> >> RewriteRule ^api(?:/(.*))?$
> >> %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]
> >>
> >> # Images
> >> RewriteCond %{HTTP_HOST} ^www.domain.tld$
> >> RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$
> >> %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L]
> >> RewriteCond %{HTTP_HOST} ^www.domain.tld$
> >> RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$
> >> %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L]
> >> RewriteCond %{HTTP_HOST} ^www.domain.tld$
> >> RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$
> >> %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L]
> >> RewriteCond %{HTTP_HOST} ^www.domain.tld$
> >> RewriteRule
> ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$
> >> %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L]
> >> RewriteCond %{HTTP_HOST} ^www.domain.tld$
> >> RewriteRule
> ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$
> >> %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L]
> >> RewriteCond %{HTTP_HOST} ^www.domain.tld$
> >> RewriteRule
> ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$
> >> %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L]
> >> RewriteCond %{HTTP_HOST} ^www.domain.tld$
> >> RewriteRule
> ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$
> >> %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg
> >> [L]
> >> RewriteCond %{HTTP_HOST} ^www.domain.tld$
> >> RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$
> >> %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L]
> >> RewriteCond %{HTTP_HOST} ^www.domain.tld$
> >> RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$
> >> %{ENV:REWRITEBASE}img/c/$1$2.jpg [L]
> >> # AlphaImageLoader for IE and fancybox
> >> RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$
> >> js/jquery/plugins/fancybox/images/$1.$2 [L]
> >>
> >> # Dispatcher
> >> RewriteCond %{REQUEST_FILENAME} -s [OR]
> >> RewriteCond %{REQUEST_FILENAME} -l [OR]
> >> RewriteCond %{REQUEST_FILENAME} -d
> >> RewriteRule ^.*$ - [NC,L]
> >> RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L]
> >>
> >>
> >>
> >> But when I visit https://www.domain.tld/sdfsdf/, an internal server
> >> errors appears. In apache error log:
> >>
> >> [Tue Apr 18 12:28:43.520237 2023] [core:error] [pid 521174:tid
> >> 140459917698624] [client 90.x.x.x:47218] AH00124: Request exceeded the
> >> limit of 10 internal redirects due to probable configuration error.
> >> Use 'LimitInternalRecursion' t
> >> o increase the limit if necessary. Use 'LogLevel debug' to get a
> backtrace.
> >> [Tue Apr 18 

Re: [users@httpd] Help with mod_rewrite

2023-04-19 Thread Frank Gingras
I would start with the rewrite log in your development environment, if you
can't change the configuration on the live server.

I would also look to replace this entire mess with a FallbackResource
directive.

On Tue, Apr 18, 2023 at 6:32 AM Marc Serra  wrote:

> Hi,
>
> A few weeks ago we renewed our prestashop website.
>
> One of the new features is the support for multiple languages.
>
> A typical home URL are...
> https://www.domain.tld/gb/ for english
> https://www.domain.tld/es/ for spanish
> etc.
>
> A typical product URL are...
>
> https://www.domain.tld/gb/PRODUCT_CATEGORY_FRIENDLY_URL/PRODUCT_CODE-PRODUCT_URL_FRIENDLY_DESCRIPTION.html
> for english
>
> https://www.domain.tld/es/PRODUCT_CATEGORY_FRIENDLY_URL/PRODUCT_CODE-PRODUCT_URL_FRIENDLY_DESCRIPTION.html
> for spanish
> etc.
>
> Our old URL wasn't contain the language, for example:
> https://www.domain.tld/.html for home
>
> https://www.domain.tld/PRODUCT_CATEGORY_FRIENDLY_URL/PRODUCT_CODE-PRODUCT_URL_FRIENDLY_DESCRIPTION.html
> for product
> etc.
>
> I'm trying to save the old URL and move to our default language (gb
> for example).
>
> For start, I added the following two lines at the beginning of the
> htaccess file. I try to redirect any URL not starting with /gb/ to the
> english home page instead of 404 page ...
>
> RewriteCond %{REQUEST_URI} !^/gb/
> RewriteRule ^.*$ /gb/ [L]
>
> # Followed by the prestashop default rules ...
>
> RewriteRule . - [E=REWRITEBASE:/]
> RewriteRule ^api(?:/(.*))?$
> %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]
>
> # Images
> RewriteCond %{HTTP_HOST} ^www.domain.tld$
> RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$
> %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L]
> RewriteCond %{HTTP_HOST} ^www.domain.tld$
> RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$
> %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L]
> RewriteCond %{HTTP_HOST} ^www.domain.tld$
> RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$
> %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L]
> RewriteCond %{HTTP_HOST} ^www.domain.tld$
> RewriteRule
> ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$
> %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L]
> RewriteCond %{HTTP_HOST} ^www.domain.tld$
> RewriteRule
> ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$
> %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L]
> RewriteCond %{HTTP_HOST} ^www.domain.tld$
> RewriteRule
> ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$
> %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L]
> RewriteCond %{HTTP_HOST} ^www.domain.tld$
> RewriteRule
> ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$
> %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg
> [L]
> RewriteCond %{HTTP_HOST} ^www.domain.tld$
> RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$
> %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L]
> RewriteCond %{HTTP_HOST} ^www.domain.tld$
> RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$
> %{ENV:REWRITEBASE}img/c/$1$2.jpg [L]
> # AlphaImageLoader for IE and fancybox
> RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$
> js/jquery/plugins/fancybox/images/$1.$2 [L]
>
> # Dispatcher
> RewriteCond %{REQUEST_FILENAME} -s [OR]
> RewriteCond %{REQUEST_FILENAME} -l [OR]
> RewriteCond %{REQUEST_FILENAME} -d
> RewriteRule ^.*$ - [NC,L]
> RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L]
>
>
>
> But when I visit https://www.domain.tld/sdfsdf/, an internal server
> errors appears. In apache error log:
>
> [Tue Apr 18 12:28:43.520237 2023] [core:error] [pid 521174:tid
> 140459917698624] [client 90.x.x.x:47218] AH00124: Request exceeded the
> limit of 10 internal redirects due to probable configuration error.
> Use 'LimitInternalRecursion' t
> o increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
> [Tue Apr 18 12:28:43.520326 2023] [core:error] [pid 521174:tid
> 140459917698624] [client 90.x.x.x:47218] AH00124: Request exceeded the
> limit of 10 internal redirects due to probable configuration error.
> Use 'LimitInternalRecursion' t
> o increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
>
> If I visit https://www.domain.tld/gb/, an internal server errors
> appears. In apache error log (the same):
>
> [Tue Apr 18 12:28:03.961530 2023] [core:error] [pid 521174:tid
> 140460882368064] [client 90.x.x.x:37092] AH00124: Request exceeded the
> limit of 10 internal redirects due to probable configuration error.
> Use 'LimitInternalRecursion' t
> o increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
> [Tue Apr 18 12:28:03.961606 2023] [core:error] [pid 521174:tid
> 140460882368064] [client 90.x.x.x:37092] AH00124: Request exceeded the
> limit of 10 internal redirects due to probable configuration error.
> Use 'LimitInternalRecursion' t
> o increase the limit if necessary. Use 'LogLevel debug' to 

[users@httpd] Help with mod_rewrite

2023-04-18 Thread Marc Serra
Hi,

A few weeks ago we renewed our prestashop website.

One of the new features is the support for multiple languages.

A typical home URL are...
https://www.domain.tld/gb/ for english
https://www.domain.tld/es/ for spanish
etc.

A typical product URL are...
https://www.domain.tld/gb/PRODUCT_CATEGORY_FRIENDLY_URL/PRODUCT_CODE-PRODUCT_URL_FRIENDLY_DESCRIPTION.html
for english
https://www.domain.tld/es/PRODUCT_CATEGORY_FRIENDLY_URL/PRODUCT_CODE-PRODUCT_URL_FRIENDLY_DESCRIPTION.html
for spanish
etc.

Our old URL wasn't contain the language, for example:
https://www.domain.tld/.html for home
https://www.domain.tld/PRODUCT_CATEGORY_FRIENDLY_URL/PRODUCT_CODE-PRODUCT_URL_FRIENDLY_DESCRIPTION.html
for product
etc.

I'm trying to save the old URL and move to our default language (gb
for example).

For start, I added the following two lines at the beginning of the
htaccess file. I try to redirect any URL not starting with /gb/ to the
english home page instead of 404 page ...

RewriteCond %{REQUEST_URI} !^/gb/
RewriteRule ^.*$ /gb/ [L]

# Followed by the prestashop default rules ...

RewriteRule . - [E=REWRITEBASE:/]
RewriteRule ^api(?:/(.*))?$
%{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]

# Images
RewriteCond %{HTTP_HOST} ^www.domain.tld$
RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$
%{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L]
RewriteCond %{HTTP_HOST} ^www.domain.tld$
RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$
%{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L]
RewriteCond %{HTTP_HOST} ^www.domain.tld$
RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$
%{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L]
RewriteCond %{HTTP_HOST} ^www.domain.tld$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$
%{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L]
RewriteCond %{HTTP_HOST} ^www.domain.tld$
RewriteRule 
^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$
%{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L]
RewriteCond %{HTTP_HOST} ^www.domain.tld$
RewriteRule 
^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$
%{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L]
RewriteCond %{HTTP_HOST} ^www.domain.tld$
RewriteRule 
^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$
%{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg
[L]
RewriteCond %{HTTP_HOST} ^www.domain.tld$
RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$
%{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L]
RewriteCond %{HTTP_HOST} ^www.domain.tld$
RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$
%{ENV:REWRITEBASE}img/c/$1$2.jpg [L]
# AlphaImageLoader for IE and fancybox
RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$
js/jquery/plugins/fancybox/images/$1.$2 [L]

# Dispatcher
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L]



But when I visit https://www.domain.tld/sdfsdf/, an internal server
errors appears. In apache error log:

[Tue Apr 18 12:28:43.520237 2023] [core:error] [pid 521174:tid
140459917698624] [client 90.x.x.x:47218] AH00124: Request exceeded the
limit of 10 internal redirects due to probable configuration error.
Use 'LimitInternalRecursion' t
o increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Tue Apr 18 12:28:43.520326 2023] [core:error] [pid 521174:tid
140459917698624] [client 90.x.x.x:47218] AH00124: Request exceeded the
limit of 10 internal redirects due to probable configuration error.
Use 'LimitInternalRecursion' t
o increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

If I visit https://www.domain.tld/gb/, an internal server errors
appears. In apache error log (the same):

[Tue Apr 18 12:28:03.961530 2023] [core:error] [pid 521174:tid
140460882368064] [client 90.x.x.x:37092] AH00124: Request exceeded the
limit of 10 internal redirects due to probable configuration error.
Use 'LimitInternalRecursion' t
o increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Tue Apr 18 12:28:03.961606 2023] [core:error] [pid 521174:tid
140460882368064] [client 90.x.x.x:37092] AH00124: Request exceeded the
limit of 10 internal redirects due to probable configuration error.
Use 'LimitInternalRecursion' t
o increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

Can anyone help me?

Thank's

-- 
Marc Serra

-- 


   
  
  
  

 Manxa 1876, S.L.
Ctra. Les 
Tries, 85.17800 Olot (Girona)
*Tel. 972 27 45 30 www.manxa.com 
* 

  *Manxa 
Industrial *
 
  *Manxa Ferros *
   *Manxa Ferreteria i Parament