How remove index.php from URL? Works on MAMP, but not Ubuntu. [SOLVED] |
[eluser]CoderReborn[/eluser]
I have it working on my Mac (MAMP), but can't get it working on my Ubuntu (Lucid) hosted server. This works: mysite.com/index.php/home But this generates 404 errors: mysite.com/home I've followed the instructions from this post. Code: RewriteEngine on - I've confirmed that mod_rewrite is loaded on Apache2. - The .htaccess file is in the webroot (/var/www), which is also where my index.php and system directory is. - The .htaccess file permissions are: -rwxrwxr-x Thanks!
[eluser]Matheus Rocha[/eluser]
Hi, My .htaccess for this propose is so: RewriteEngine on RewriteBase / RewriteCond $1 !^(index\.php|assets|uploads|robots\.txt) RewriteRule ^(.*)$ index.php/$1 [L] Note: RewriteBase / - after the slash, you must temporarily place the relative path to your base_url: Exemple: Your app in the directory in your server is here: public_html/mysite/... Your RewriteBase will look like: RewriteBase /mysite/ Hope this helps..
[eluser]Matheus Rocha[/eluser]
Humm.. I work on mac with MAMP too and this working 100%. You apache has mod_rewrite on?
[eluser]CoderReborn[/eluser]
I have it working on my Mac. But it's not working on Ubuntu. I've tried about 25 different answers and none of them work. Yes, I have mod_rewrite on my Ubuntu server. What other settings need to be setup on Ubuntu?
[eluser]Mark Croxton[/eluser]
Check that you have AllowOverRide All (or another value other than 'None') in the httpd.conf file. Could be Apache is not reading the htaccess file.
[eluser]CoderReborn[/eluser]
Ok, I've got it working now. Here's what I did: I found out that in Ubuntu (Lucid) servers, the Apache default virtualhost configuration file) is "/etc/apache2/sites-available/default", not "httpd.conf" (which actually is empty in this O/S distribution). So, I went to that config file, and made sure that I included the following lines for my webroot directory (/var/www). Code: AllowOverride FileInfo Then I restarted Apache and it works now. |
Welcome Guest, Not a member yet? Register Sign In |