0

i have installed LAMP on Ubuntu-16.04.

Now in my var/www/html I have created a file called index.php which shows info about my PHP.

Also i have a folder called FMS which is my Codeigniter Project Folder.

When I fire localhost/FMS it shows the url to be : localhost/FMS/secure/login

but displays the index.php page

is this issue of codeigniter/.htaccess ??

Or is there anything wrong with my server configuration ?

.htaccess file:

<IfModule mod_rewrite.c>
  RewriteEngine On
  # !IMPORTANT! Set your RewriteBase here and don't forget trailing and leading
  #  slashes.
  # If your page resides at
  #  http://www.example.com/mypage/test1
  # then use
  # RewriteBase /mypage/test1/
  RewriteBase /FMS
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
 # RewriteRule ^(.*)$ index.php?/$1 [L]
  RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</IfModule>

<ifModule mod_headers.c>
Header add Access-Control-Allow-Origin "*"
</ifModule>

<IfModule !mod_rewrite.c>

apache2.conf

<Directory /var/www/html>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>
Rajan
  • 2,427
  • 10
  • 51
  • 111
  • Check that you're .htaccess uses `RewriteBase /FMS` (and doesn't rewrite to `/index.php`, but just `index.php`) – M. Eriksson Nov 12 '16 at 09:05
  • Sounds like the rewriting implemented by Codeigniter rewrites to `/index.php`. You probably want to change the `RewriteMap` in the `.htaccess` style file created by that framework. – arkascha Nov 12 '16 at 09:06
  • You can also try this: https://gist.github.com/misterzik/a86bb75ba8a0d6edd18d (which is only one of the solutions I found,using google) – M. Eriksson Nov 12 '16 at 09:10
  • @arkascha i have added my .htaccess please see if its okay – Rajan Nov 12 '16 at 09:11
  • I told you in my comment what you could try to change/check. – M. Eriksson Nov 12 '16 at 09:11
  • @MagnusEriksson i also tried keeping rewrite base to FMS but its not working – Rajan Nov 12 '16 at 09:12
  • @MagnusEriksson i made changes in my .htaccess please check it – Rajan Nov 12 '16 at 09:29
  • What is the location of the index.php you would like served when requesting `http://localhost/FMS` ? – Chris Stryczynski Nov 12 '16 at 10:23
  • @Chris the index.php is in /var/www/html and in that index.php i have written only echo phpinfo(); – Rajan Nov 12 '16 at 10:27
  • @Rajan, Yes I understand, but what file do you want served (from apache) when requesting `http://localhost/FMS`? I'm guessing you want an index.php file located somewhere within your Code ignitor directory, if so please provide the full path to this file. – Chris Stryczynski Nov 12 '16 at 11:40

0 Answers0