How to enable mod_rewrite in Apache on Ubuntu
To enable mod_rewrite in Apache on Ubuntu run:
sudo a2enmod rewrite
Open /etc/apache2/sites-enabled/000-default in an editor (for example Nano)
sudo nano /etc/apache2/sites-enabled/000-defaultand change
AllowOverride Noneto
AllowOverride All
restart Apache:
sudo service apache2 restart
mod_rewrite module is enabled.
-
Dilip2012-10-16 11:42:25
jc / Great Article!
We have Magento 1.6 installed in a sub-directory. We've coiepd .htaccess and index.php to the root directory. So we have 2 .htaccess files:
/.htaccess
/magento/.htaccess
The site works fine except for this index.php in the url. Does anyone have any insight on how to remove it when your installation is in a sub-directory.
Ive already verified that:
1. httpd.conf's Allow Override = All
2. System->Config->Web->Use Web Server Rewrites = Yes
3. System->Config->Web->Use Secure URLs in Frontend = Yes
In /.htaccess RewriteBase /magento/
In /magento/.htaccess #RewriteBase (commented out)
Thanks!
-
unixowl2012-10-16 12:14:26
Hi
1. you don't need .htaccess in the root directory;
2. in the /magento/.htaccess you need something like this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /magento/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /magento/index.php [L]
</IfModule>
Got a comment?
All Rights Reserved.