/ 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.
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
# Redirect visitors to another directory
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*)$ /sub_dir/index.html [NC,L,QSA]
URL: http://www.apphp.com/index.php?snippet=htaccess-redirect-to-another-directory
Comments
 Subscribe to comments
                    Subscribe to comments
                
                