Hello,
I'm French and I come to the community contao.org, because I can not find a solution to my problem.
Let me explain:
I am trying to make the activation of url-rewriting a website already online. Here is the code that I use and that works perfectly:
Now, if a visitor comes to the site via website.com, it will automatically be redirected to http://www.website.com. In addition, the index.php (in website.com/index.php/name-page.html) is automatically deleted.Code:AddType x-mapp-php5 .php DirectoryIndex index.php RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^.*\.html$ index.php [L] RewriteCond %{HTTP_HOST} ^website.com [NC] RewriteCond %{HTTP_HOST} !^www.website.com [NC] RewriteRule ^(.*)$ http://www.website.com/$1 [L,R=301] ErrorDocument 404 /error-404.html
And therein lies the trouble, because if a visitor arrives via the old URL, eg:
website.com/index.php/services.html there be a 404 because the new address is http://www.website.com/services.html
Clearly, how to make the old URLs (with /index.php/) redirect to the new address?
Thank you in advance for your solutions!


Reply With Quote
Bookmarks