Peri Hartman
Peri Hartman

Reputation: 19484

apache rewriteengine match everything - error 500

I'm trying to do a very basic rewrite that matches every URL and simply inserts "prod/". Here's what's in .htaccess (I'm on a shared server):

RewriteEngine on
RewriteRule ^(.*)$ prod/$1

This is causing a server internal error - 500. I can write a more specific rule, such as

RewriteRule ^/?$ prod/index.html

which works fine.

Upvotes: 0

Views: 49

Answers (1)

covener
covener

Reputation: 17886

You'll need to (at least) avoid looping w/ e.g.

RewriteCond %{REQUEST_URI} !/prod/

I would also be cautious about that relative substitution -- see the complexity discussed in the RewriteBase manual.

Upvotes: 1

Related Questions