0

I tried to set this RewriteCond in httpd 2.4.4:

...
RewriteCond expr "%{QUERY_STRING} =~ /welcome/"
RewriteRule ^(.*)$ %1\.html

So, if I visit https://localhost/?welcome , for example, I should see the page https://localhost/welcome.html.

Instead, it returns a 500 Internal Server Error. Why?

The error log reads:

Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

TRiG
  • 1,181
  • 3
  • 13
  • 30
sl34x
  • 23
  • 4
  • On HTTP 500 there should be something in your error.log – Pascal Schmiel Jun 06 '13 at 11:12
  • @PascalSchmiel Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. – sl34x Jun 06 '13 at 11:15

1 Answers1

0

Try:

RewriteCond %{QUERY_STRING}  (welcome)
RewriteRule ^.*$ %1.html

This replaces the %1 with the matching group from the RewriteCond. Because you are using here a static string you can just use:

RewriteCond %{QUERY_STRING}  welcome
RewriteRule ^.*$ welcome.html
Pascal Schmiel
  • 1,738
  • 12
  • 17