How to fix nested URLs in PHP

时间:2016-04-07 10:27:05

标签: php

Can't seem to figure this out for some reason. But how can you fix the nested urls in PHP?

example.com/index.php/index.php/index.php/index.php/index.php

How can you make it so you can't nest a url like this? It leads to broken images, I'm really confused. If anyone can help it'd be appreciated.

1 个答案:

答案 0 :(得分:1)

You can create .htaccess file in Microsoft Wordpad or Notepad and save it to the name .htaccess (note that older versions of Notepad do not allow this). and write the below code in that file. Upload this file where index.php file is.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $index.php [NC,L]