In a previous post, I shared my love for code matching through all stages of development. If you're working on an Apache web server with C5 Pretty URLs enabled, the default .htaccess will likely need to change along the way. Here's the default code after a fresh install in my MAMP setup:

# -- concrete5 urls start --
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /concrete5tricks/httpdocs/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule . index.php [L]
</IfModule>
# -- concrete5 urls end --

The RewriteBase /concrete5tricks/httpdocs/ is a path specific to my local machine. This is because I make new sites in subdirectories instead of the web root. That path will need to change when I move it to our stage and production web servers. In an ideal world, we wouldn't need this code at all. And luckily (for us and hopefully you), we don't with a small modification to the RewriteRule.

# -- concrete5 urls start --
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule ^(.*)$ index.php [L]
</IfModule>
# -- concrete5 urls end --

Viola/walah! A RewriteRule that doesn't need a RewriteBase.

A few words of caution

Rewrite rule work is complicated. I took a stab at explaining the details of this code in depth, but realized I'm not really qualified. We stumbled into it on a LemonStand project. It has worked for us in several setups. And since LemonStand is a pretty big eCommerce solution, I have a reasonable amount of confidence their code will work for you, too.

Please let us know if it works (or doesn't work) for you in the comments. And if you can poke holes in this solution or can help improve it, please let us know!