Apache Redirect within public_html (~username)

Jeff Schroeder jeff at zingstudios.com
Fri Apr 30 10:37:20 MDT 2010


Michael:

> I know how to do the Redirects from inside the apache conf file.  How
> can I do this in an .htaccess file in my public_html directory?

It's done exactly the same as the Apache configuration file.  For 
example, if you have this in your Apache file:

  <Directory /here/there/everywhere>
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^.*$ index.php [PT,NC,L]
  </Directory>

You could just place an .htaccess file in /here/there/everywhere and use 
this in the file:

    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^.*$ index.php [PT,NC,L]

Obviously your rules would be different, but the point is they're 
structured the same regardless of whether they're in the Apache server 
file or an .htaccess file.

HTH,
Jeff


More information about the PLUG mailing list