0

I am working on a codeigniter site. In the .htaccess file I found this rule:

RewriteBase /

After reading up on RewriteBase, I started to wonder if this rule actually does anything within this context (if the htaccess file is placed within the root folder.) Is it safe to remove?

Even after reading the documentation and other posts, I am still very confused about what this does. Is this RewriteBase directive needed if the .htaccess file is in the root folder? WIll it behave differently within htaccess files located in folders that are not?

Hoytman
  • 1,722
  • 2
  • 17
  • 29
  • Document is your friend: http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase – Prix Feb 20 '14 at 20:41
  • http://stackoverflow.com/questions/704102/how-does-rewritebase-work-in-htaccess – The Alpha Feb 20 '14 at 20:41
  • I read that document a few times. I'm still missing the point. If the relative path is also the absolute path, is this directive having any effect (other than slowing down the system?) – Hoytman Feb 20 '14 at 21:01

1 Answers1

0

The RewriteBase directive specifies the URL prefix to be used for per-directory (htaccess) RewriteRule directives that substitute a relative path.

So whenever you use something that requires a relative path in the RewriteRule statements, it will use slash.

http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase

Eric Leschinski
  • 146,994
  • 96
  • 417
  • 335