why does my website hosted on php server shows www.abc.com/index.php, and why not www.abc.com
all the webpages are lying in one folder only.
how to correct it?
Thanks in advance
why does my website hosted on php server shows www.abc.com/index.php, and why not www.abc.com
all the webpages are lying in one folder only.
how to correct it?
Thanks in advance
.htaccess
RewriteCond %{THE_REQUEST} ^.*/index\.php
RewriteRule ^(.*)index.php$ /$1 [R=301,L]
Put this in your htaccess.
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
As per the Apache documentation for DirectoryIndex, simply put the following in a .htaccess
file in the same directory as index.php
:
RewriteCond %{THE_REQUEST} ^.*/index\.php
RewriteRule ^(.*)index.php$ /$1 [R=301,L]
DirectoryIndex index.php index.html