M
M
Michael2015-12-11 10:19:50
Search engines
Michael, 2015-12-11 10:19:50

Additional "index.php" in url. How to remove?

I noticed in the search engine that the following address bar appears on my site www.site.RU/index.php/index.php?href=main. There is no such link in scripts. Navigation happens through href=main. Tell me why is that? The site is self-written.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg Prilepa, 2015-12-11
@Madfisht3

Such things are usually decided by rules in .htaccess

<IfModule mod_rewrite.c>
  Options +FollowSymLinks
  RewriteEngine On
  # Переадресация с добавлением / в конце
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^([^.]+)(?<!/)$ /$1/ [R=301,L]
  # Переадресация с домена с WWW на домен без WWW
  RewriteCond %{HTTP_HOST}	^www\.(.*)	[NC]
  RewriteRule ^(.*)$ http://%1/$1	[R=301,L]
  # Переадресация с index.php на /
  RewriteCond %{REQUEST_FILENAME} ^(.*)/index\.php$
  RewriteRule ^(.*)index\.php(.*)$ /$1$2 [R=301,L]
</IfModule>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question