Do any of the sites hosted on your webserver use Mod Rewrite with .htaccess files?
Friendly URL's are becoming more and more common and many sites rely on them for both added security and to make usability easier. Here is a quick and easy guide to getting Mod Rewrite working on your new Apache 2 installation along with a quick fix if you find that although the module is installed, it dosnt appear to be working.
Firstly, remember that Apache does not come with this module enabled as default so you will need to firstly enable it. As super (root) user type the following:
# a2enmod rewrite
# /etc/init.d/apache2 force-reload
Running this command tells apache that you need the rewrite module enabled.
The second line restarts the apache server. Thats it... hopefully...
If you are a debian / ubuntu user i suggest you read on. If your not, hopefully you should be up and working.
With Debian/Ubuntu it is often the case that although mod-rewrite is enabled it does not work as you would expect. You therefore need to edit your 000-default file a little.
Type the following at the terminal (as root user) to begin modifying the file:
# gedit /etc/apache2/sites-enabled/000-default
Find the following line and change AllowOverride from None to All
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
# Uncomment this directive is you want to see apache2's
# default start page (in /apache2-default) when you go to /
#RedirectMatch ^/$ /apache2-default/
</Directory>
Finally, upload your .htaccess file, restart your server and you should be good to go.
# /etc/init.d/apache2 force-reload
Finally, if you are getting any permission problems with your .htaccess files check that your permissions are set to 644. (use the
chmod command to change them)
Posted by OLLIE at 21:13pm
No comments yet. Be the first to add one!