Posted By

apphp-snippets on 02/26/16


redirect htaccess directory

Versions (?)

Redirect to Another Directory in .htaccess

 / Published in: PHP


This example shows you how to create redirection o another directory. It may be useful, for example, when you have a project, placed in sub-directory.

  1. # Redirect visitors to another directory
  2. RewriteEngine on
  3. RewriteCond %{REQUEST_FILENAME} !-f
  4. RewriteCond %{REQUEST_FILENAME} !-d
  5. RewriteRule ^([^?]*)$ /sub_dir/index.html [NC,L,QSA]

Report this snippet  

You need to login to post a comment.