3

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]

1 Answer 1

3

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]
Sign up to request clarification or add additional context in comments.

5 Comments

thanks for the reply, check this - 127.0.0.1 dev.bonanza.com this is what i added in the host
did you check my virtual host settings? anything wrong in that? actually everything is works for me but can't remove the index.php from the url :(
try changing DocumentRoot "E:/Projects/OnGoing/bonanza/dev.bonanza.com" ,if still not working can you share the folder structure.
Change also AllowOverride None to AllowOverride All
hey AllowOverride All works, thank you so much, You are really great

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.