Posted By

apphp-snippets on 02/26/16


Tagged

redirect htaccess directory


Versions (?)

Redirect to Another Directory in .htaccess


 / Published in: PHP
 

URL: http://www.apphp.com/index.php?snippet=htaccess-redirect-to-another-directory

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.