Redirect file error

Hello,

Trying to unify the URLs of my website (https://www.boncaillou.org) which sometimes point to http and sometimes also lack the www, I followed OVH’s step‑by‑step guide for redirects, and since then nothing works for me, and it overwrote the previous redirects.
Do I have a solution to revert everything to how it was at first or to make the unification work and be clean?
I'm not a developer (although I did code my site in HTML and CSS anyway) using the SPIP CMS (yes, I know it’s outdated…)

Thanks for your help!

Didier

Hello @DidierM36

This is more common than it seems :sweat_smile: because the redirects in the OVH panel overwrite existing ones without clear notification, and sometimes they conflict with the rules in the .htaccess you already had.

It is very likely that when you created the new redirect, you overwrote the ones you already had, and now you have a rule that conflicts with your SPIP .htaccess.

Let's try to fix it :wink:

  1. Delete the redirects from the OVH panel
    Log into your client area, go to Web Cloud > Domains > boncaillou.org > Redirection tab. If you see any active redirect, delete it. This will prevent the panel from continuing to interfere.

  2. Work directly with the .htaccess
    The .htaccess file is the right tool to unify HTTP/HTTPS and with/without www, and it works immediately.
    :warning: Before touching anything, make a backup of the current .htaccess. Connect via FTP, download the file and save it.

  3. Apply the unification rules
    For your case, the cleanest solution is to force everything to https://www.boncaillou.org. Add this at the beginning of the .htaccess, after RewriteEngine On:

    RewriteEngine On
    
    RewriteCond %{HTTPS} off [OR]
    RewriteCond %{HTTP_HOST} !^www. [NC]
    RewriteRule ^ https://www.boncaillou.org%{REQUEST_URI} [L,R=301]
    
  4. Watch out for SPIP and HTTPS
    SPIP is compatible with HTTPS, but you need to make sure the site configuration is as well. Once the .htaccess works, go to the private area of SPIP, go to Settings > Adresse du site (that's how it's said in French :sweat_smile:) and make sure the URL is https://www.boncaillou.org. Then clear the SPIP cache.

  5. Test and adjust
    All should redirect to https://www.boncaillou.org.

If after this the site is still down, check that there is no syntax error in the .htaccess.

Hope I helped you :wink:
Sergio Turpín

Hello @DidierM36

At my place https://www.boncaillou.org --> good