Jump to content

Recommended Posts

Hi,

 

I'm not sure why but search engines are indexing the following urls on my site:

 

domain.com/index.php/about-us

domain.com/index.php/contacto

domain.com/index.php/any-word-can-go-here

 

These aren't URLs I'm using or are in my sitemap.

 

Can anyone tell me how I can turn off these URLs after the .php ?

 

I'm not sure why this is happening or what words to use to find out what my problem is.

Link to comment
https://forums.phpfreaks.com/topic/298817-indexphprandom-word-here/
Share on other sites

Hi,

 

No, never.

 

You can write anything after index.php/ and the index.php file loads up. Any resources on the page with a relative url won't work though. So ../image.jpg will work on index.php but not index.php/about-us.

 

I can only assume there's an on/off setting. I have PHP 5.6 installed.

I'm not sure what would have caused them to index those pages to start with. Maybe some other site linked to your site with those pages for some reason. In any case, now that they are indexed, they're likely to remain that way for a while. Are you returning a proper 404 header for those pages?

I have a file called index.php and I want to have a file called index.php

 

What I don't want, is for the ability of the public to be able to type domain.com/index.php/what-ever-words-they-want-to-type.

 

At the moment when they go to domain.com/index.php/what-ever-words-they-want-to-type it loads my domain.com/index.php.

 

I'm not sure why this happens.

Search your code for a header location to index.php

 

header('Location:

 

Also look in .htaccess for an existing redirect

 

If you dont find anything there, the other place would be in the server conf file if you have access it it.

 

You first need to find out where and what your current redirect method is.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.