Incorrect googled links

I did google my site and wonder my links are
http://www.mysite.com/index.php/blah.php
I clicked each and every link and i got redirected to .com/blah.php. All links are relative like href=“blah.php”, i also looked at my xml sitemap and all links were .com/blah.php so why some of my links appear like .com/index.php/blah.php ? What else should i check to correct?

If clicking on the link in Google takes people to the right page, does it matter if they’ve formatted the URL in a funny way?

It redirects them to my site but images and css are not loaded. What to check to fix wrong url indexed?

I Google your website “My Site” and I did`t see any /index.php/blah.php links even after redirecting to your website.
If your website images and css files are not loading properly try to reduce the size.

I found that your website has many gifs files. try to reduce those file

Hope this will help

Our site is not “My Site”. In generally I meant if this happens, what could be the problem.

Are you using a CMS for your site?

No, i created my own template engine. In general what might causes this google problem?

Frankly, I’ve no idea. Have you tried using “Fetch as Googlebot” in Webmaster Tools, to see if there are any obvious problems? Have you checked all your internal site links to ensure they’re set up correctly?

Yes I fetched both [noparse]http://www.mysite.com/[/noparse] and [noparse]http://www.mysite.com/sitemap.xml[/noparse] as well as adding sitemap in that separate area in GWT. What else should I check? All iternal links are relative like href=“pag.php”.

Any idea?

Sounds like there is an index.php file involved in the processing of the pages, which is pretty common. With some CMSes, you have to remove index.php from the URL via a .htaccess file. Probably worth doing the same in your case, so that search engines won’t be able to see the index.php page there at all.

Have you checked your htaccess? you might redirected through htaccess removed it first and then check again

Do you mean redirecting /index.php/ folder to root by rewrite rules in htaccess?

I meant removing the index.php part from the URL.

Actually this is not a cms, just a normal site. index.php is not a page handler like wiki but an independent homepage. But i have that google problem for unknown reason. So i guess i should 301 redirect from /index.php/ pseudo folder to repective page in root? If yes, how is the htaccess command?