Index.php does not work with modified .htaccess

Website URL

http://vnp.free.nf/

Error Message

It automatically redirects to site https://errors.infinityfree.net/errors/404/

Other Information

Hi everybody,
my main page is on index.php. It is in folder /htdocs where I made a new .htaccess file too with content: DirectoryIndex index.php but it doesnt work, the page is not accessable when I try load. What can be the problem?

You don’t need the DirectoryIndex in your .htaccess

As long as your index.php is in the /htdocs folder you’ll be fine.

2 Likes

That was the first problem, that I had that index.php file in /htdocs and it doesnt work that way. That is why I tried the htaccess file…

this is the content of the htdocs folder

That should be working fine. what error are you getting without the .htaccess file?

Remember to clear your cache to make sure thats not causing problems.

3 Likes

I tried incognito mode on chrome and it redirects me to this site: https://errors.infinityfree.net/errors/404/

I’m thinking the problem may be with your index.php then.

Are you calling any other scripts in there that might be causing the problem?

2 Likes

You were right, I hade some absolute paths in the index.php from localhost server… I corrected them on the webserver, now it works. I tought that if that would be a problem, the site would show other errors… thanks a lot for your help.

2 Likes

Easy mistake to make :slight_smile: glad its working for you now

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.