I am working on a website which implements Slim. All my category urls are defined in a sitemap and a page which describes all the structure with links. But I don't precise the urls of the articles in the categories of my sitemap. My webesite is on production and Google indexes al the articles. But the urls in google are like
wrong url : www.domain.com/index.php/category/blabla/article-title
instead of
good url : www.domain.com/category/blabla/article-title
In the website, when you click on a link to display an article, the url in the nacigator is the good one. It makes the wrong url only in the google index. I don't know where it comes from, could someone tell me please ? Here is the code of the url :
$app->group('/' . $ed->nomXML . '/', $handleMenu(), function () use ($app, $rubriques, $ed) {
//display article
$app->get($formatRubrique.'/evenements/:id/:titre', function ($id, $titre) use ($app) {
$ctrl = new ArticleController();
$ctrl->viewArticle($app, $id);
});
}
and the code of .htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]