Ako na mod_rewrite v Ubuntu

Po úspešnej inštalácii Ubuntu a následne Apache mi nechcel fungovať s mod_rewrite. Hodil som to do Google a našiel http://snippets.dzone.com/posts/show/6206 Ako som sa pozrel do /etc/apache2/sites-available/default ďalej som už ani nemusel hľadať riešenie, lebo defaultne je rewrite vypnutý 😛 Kto to tušil? Postupoval som nasledovne:

1. Zapnutie modulu mod_rewirte s a2enmod (Apache2 ENable MODule)

sudo a2enmod rewrite

2.Aby modul prepisoval treba ho ešte povoliť v konfigurácii Apache nasledovne

sudo vi /etc/apache2/sites-available/default

ServerAdmin webmaster@localhost
DocumentRoot /var/www/

Options FollowSymLinks
AllowOverride All # Povoli rewrite

Options Indexes FollowSymLinks MultiViews
AllowOverride All # Povoli rewrite
Order allow,deny
Allow from all

3. Už len reštart apache

sudo /etc/init.d/apache2 restart

Advertisements

About Michal Zuber

Full stack developer, biker and rollerblader. Owner and developer at https://nevilleweb.sk/ Co-founded http://neville.sk/ Blog at https://michalzuber.wordpress.com/
This entry was posted in linux, ubuntu. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s