Do 301 redirect correctly

Hello again, I have a question with 301 redirects that I don’t know how to solve, since everything I can find on the internet is how to do it from wordpress to wordpress.
I want to redirect my old WordPress website to the new Sitely website.
Would it be like this for each page? 301 Redirect https://dominio.com/page/ https://dominio.com/page.html

Hello,

If your new Sitely site is hosted on the same domain as your old WordPress site and you have maintained a similar URL structure, you may not necessarily need to set up redirects. You can simply adjust the settings of your pages in Sitely to match the old URLs.

For example, if you want the URL of your page to be https://dominio.com/page/, you can configure this directly in Sitely as follows:

  1. In your page settings, place the page in a folder named page.
  2. Then rename the page to index.html (or index.php if your page uses PHP).

(Note that you can have multiple index.html or index.php files as long as they are in different folders.)

This way, when someone visits https://dominio.com/page/, the server will automatically look for an index.html or index.php file in the corresponding folder and display that page.

However, if you prefer not to use this method or if some URLs differ, you will indeed need to set up 301 redirects. To configure redirects page by page, I’ve explained the process in detail in this topic: Migration strategy.

I don’t need the domain/page/… structure I only need domain/… so being on the same server and same domain I just need to delete the old website, insert the new Sitely website at the root, and do the redirects like this:

Redirect 301 /old-page /new-page.html

or perhaps it is necessary to add https://domain/old-page / https://domain/new.page.html
Since from what I see, the WordPress addresses do not have an html or php ending, it is just the title of the page/
Which option is correct? Or are both valid?

I’m sorry if I don’t explain myself well, I’m Spanish and I use an English translator…

No worries, I also use ChatGPT to translate from French to English :blush:

Just so you know, even with WordPress sites, there is always an “index” page hidden within folders. Even if the browser displays a URL like domain.com/page/, the actual page being loaded is index.html or index.php. The full URL is actually domain.com/page/index.html, even if “index.html” is not visible in the browser. Personally, I use this structure for all my sites. The vast majority of my pages are index.html files organized into folders like /contact, /faq, /privacy, etc.

By following this method, your URLs will be cleaner, and you will have little to no need for redirects.

However, if you prefer to display page names with their extensions (e.g., /new-page.html) and set up 301 redirects, that is completely possible as well. As I mentioned earlier, I recommend checking out this guide: Migration strategy.


ES :

No hay problema, yo también uso ChatGPT para traducir del francés al inglés :blush:

Solo para que lo sepas, incluso en los sitios de WordPress, siempre hay una página “index” oculta dentro de las carpetas. Aunque el navegador muestre una URL como domain.com/page/, la página real que se carga es index.html o index.php. La URL completa es en realidad domain.com/page/index.html, aunque “index.html” no sea visible en el navegador. Personalmente, uso esta estructura para todos mis sitios. La gran mayoría de mis páginas son archivos index.html organizados en carpetas como /contact, /faq, /privacy, etc.

Siguiendo este método, tus URLs serán más limpias y apenas necesitarás configurar redirecciones.

Sin embargo, si prefieres mostrar los nombres de las páginas con sus extensiones (por ejemplo, /new-page.html) y configurar redirecciones 301, eso también es totalmente posible. Como mencioné antes, te recomiendo echar un vistazo a esta guía: Migration strategy.

Now my doubt has become much clearer to me.
To finish: wordpress, although we don’t see it, the real structure of each url page is:

https://domain.com/url-title-page/index.html

And if we configure sitely so that instead of creating a file with the name title.html we tell it to create the folder with the url-title-page, sitely will create the same url that wordpress uses:

https://domain.com/url-title-page/index.html

This way I wouldn’t have to make redirects since everything remains the same, the only thing I have to check one by one is that the folder page title I put on sitely is exactly the same as the one on wordpress.

I just did a test, and the old website, when it said:

https://domain.com/url-titlge-page/index.html

This gives 404 error page

If I put:

https://domain.com/url-tittle-page/index.php

This does work

Yes, that’s exactly it!

It is normal to get a 404 error if the original URL used index.php and your new page is index.html, or vice versa. The server is looking for the old file extension and cannot find a match.

If necessary, you can change the extension of your .html pages to .php in Sitely without any particular issue. However, the reverse is not possible. A .php page tells the server that it may contain dynamic code that needs to be executed before displaying the content. If your Sitely page is in .php, you should not change its extension, as this could cause errors.

If your old page was .html and your new page is .php, you will need to set up a 301 redirect to prevent errors and preserve your SEO.

It looks like you haven’t checked the link I shared earlier, which explains exactly how to configure these redirects. Here it is again in case you need it:
:link: https://community.sitely.app/t/migration-strategy/9309