In order to make mod_rewrite work with relative paths you first need to specify which folder the application or web page is based in. This is done with the directive RewriteBase directly after RewriteEngine in a .htaccess file.
Here is two examples of that:
- If the .htaccess file is located in the folder public_html/ you use:
- RewriteBase /
- If the .htaccess file is located in the folder public_html/subdirectory/ you use:
- RewriteBase /subdirectory/
More information about RewriteBase is available here: