Friday, March 25, 2016

ubuntu 14.04 - Remove index.php from URL Apache 2.4

I have been trying to remove index.php from my application since a day. I have tried everything but am not able to remove it. The problem is - I am not allowed to have .htaccess file in the project directory and the config in .htaccess file which works on my local dev machine does not work there.




The config I have on my local machine is:




# Rules to serve URLs which point to files directly
# ----------
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]




I am aware that I cannot use RewriteBase directive inside the host configuration file (/etc/apache2/sites-available/000-default.conf/000-default.conf). However disabling that doesn't work either.



Why is this problem so difficult? There are a lot more complicated redirections that are working perfectly, but there seems to be no definite solution to removal of index.php from the URL!



EDIT: It is installed on a Ubuntu 14.04 machine.

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...