-3

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

user3227443
  • 3
  • 1
  • 5

3 Answers3

0

@ThinkingMonkey Solution

.htaccess

RewriteCond %{THE_REQUEST} ^.*/index\.php 
RewriteRule ^(.*)index.php$ /$1 [R=301,L]
Community
  • 1
  • 1
Simone Nigro
  • 4,717
  • 2
  • 37
  • 72
0

Put this in your htaccess.

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L] 
Idris
  • 997
  • 2
  • 10
  • 27
0

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
Saurabh Sharma
  • 2,422
  • 4
  • 20
  • 41