Jump to content
Sign in to follow this  
Gingechilla

index.php/random-word-here

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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

You need to return a 404 header when an invalid page is reached. That doesn't happen automatically, you have to do that from your routing logic.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Hi.

 

Thanks for your help.

 

In the end I canonical link the file to where I wanted it to go. After that I just chose to redirect anyone who tries going to domain.com/index.php/* back to domain.com/

Share this post


Link to post
Share on other sites

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.

Sign in to follow this  

×
×
  • 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.