Reputation: 786
First of All I'm not an expert on Linux, or even Apache, I'm used to work on Windows, WAMP where you just right clic on the icon and change the configuration you want to change.
Right now I have LAMP working properly, the only thing that is not working is the HTACCESS
rewrite:
Options -MultiViews
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
This is a common HTACCESS setup.
Everytime I write the URL: localhost/mysite/services
it throws a 404 error.
You have to know that I've tried everything I've seen in Stackoverflow and Ubuntu forums.
1) When I check if the mod rewrite is active, it says it is
2) I created a "default.conf"
file in "/etc/apache2/sites-available"
and put this inside:
<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>
3) I've restarted the apache2 service after that
Nothing seems to work, I'm desperated because I have to get this done for tomorrow.
EDIT:
This exactly configuration WORKS on Windows-WAMP and Production Server (hostgator)... I just pasted all the app to my Ubuntu Laptop and here, it is not working.
Upvotes: 0
Views: 1321
Reputation: 549
I am using apache2 in Ubuntu 14 and this works fine for me.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|public|hme|img|editor|tsd|wd|images|edi|js|fonts|assets|robots\.txt|css|blog)
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
Hope this helps.
Upvotes: 1