Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Codeigniter Cannot Remove index.php after move to virtual host

Tags:

codeigniter

I created the virtual in wamp server. Everything is working but i can't able to remove the index.php. I don't know how to write the .htaccess.

Here is the details

NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot E:/Projects/OnGoing/bonanza/dev.bonanza.com
ServerName dev.bonanza.com
    <Directory "E:/Projects/OnGoing/bonanza/dev.bonanza.com">
         Options Indexes FollowSymLinks
         AllowOverride None
         Order allow,deny
         Allow from all
    </Directory>
</VirtualHost>

and my htaccess

# Turn on URL rewriting
RewriteEngine On

# Installation directory
RewriteBase /

# Allow these directories and files to be displayed directly:
# - index.php (DO NOT FORGET THIS!)
# - robots.txt
# - favicon.ico
# - Any file inside of the media/ directory
RewriteRule ^(index\.php|robots\.txt|favicon\.ico|media|uploads|js|css|images|plugins|source|files|fonts|lib|plugins) - [PT,L]

# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php?/$0 [PT,L,QSA]
like image 282
Soundhar Raj Avatar asked Dec 07 '25 09:12

Soundhar Raj


1 Answers

Did you setup your host file correctly to read the path of your site? For me I used this all the time works fine in development server.

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-s
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
like image 125
Japet Felipe Avatar answered Dec 10 '25 03:12

Japet Felipe