Category: .htaccess

Enable .htaccess in Apache2

At first You should define,  mod_rewrite is a part of Apache server that can rewrite requested urls on the fly. To enable in Ubuntu, you just need to write this command in terminal sudo a2enmod rewrite Then edit /etc/apache2/sites-available/default Find the following Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all and change …

Continue reading

Permanent link to this article: https://blog.openshell.in/2010/12/enable-htaccess-in-apache2/

404 Page on a Static Site

Here’s a very quick, but very useful trick. You can catch 404 errors (page not found) on a static site and serve up a custom 404 page with a one-liner in your .htaccess file: ErrorDocument 404 /404.php The “/404.php” part is the path to whatever file you want to serve up as the error page. …

Continue reading

Permanent link to this article: https://blog.openshell.in/2010/12/404-page-on-a-static-site/