info:concrete5:59:move

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
info:concrete5:59:move [2025/09/19 04:57] – supprimée - modification externe (Date inconnue) 127.0.0.1info:concrete5:59:move [2025/09/19 04:57] (Version actuelle) radeff
Ligne 1: Ligne 1:
 +====== move / migrate ======
 +{{tag>c5 c59}}
 +
 +//How to move a concrete5 website from a subdirectory to the root directory of your webserver?//
 +
 +<note tip>If you want to move your concrete5's website from one server (eg localhost) to another server, please see the official documentation:
 +
 +  * https://documentation.concrete5.org/developers/installation/moving-a-site
 +  * https://legacy-documentation.concrete5.org/developers/installation/moving_a_site (legacy c5.6)
 +</note>
 +
 +Now, considering you just want to move your website from a subdirectory to the root directory (or the reverse), here is a small doc
 +
 +<note>
 +For instance, you want to move your website from 
 +   https://YourwebSite/PreviousSubDirectory 
 +to
 +   https://YourwebSite/
 +</note>
 +
 +<code>
 +# This doc is distributed in the hope that it will be useful,
 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 +# GNU General Public License for more details, 
 +# https://www.gnu.org/licenses/gpl-3.0.en.html
 +</code>
 +
 +  * First, upgrade your website if required
 +  * Log as an admin in your website:
 +
 +   https://YourwebSite/PreviousSubDirectory/index.php/login
 +
 +  * Clear the cache from the dashboard
 +  * Put your website in maintenance
 +  * If you don't have a recent one, **MAKE A COMPLETE BACKUP** (website + database)
 +  * Go to your system files (FTP or SSH)
 +  * Move ALL the files from the subdirectory to the root directory
 +  * fix the permissions by running this command
 +
 +   chmod -R 777 packages application/config/ application/files/ application/languages
 +
 +
 +===== .htaccess =====
 +if you have any, edit your .htaccess file:
 +
 +  replace
 +
 +  RewriteBase /PreviousSubDirectory/
 +  
 +with
 +
 +   RewriteBase /
 +
 +  * Log in as an admin in your moved website, https://YourwebSite/index.php/login
 +  * De-activate the maintenance
 +
 +  https://YourwebSite/index.php/dashboard/system/permissions/maintenance
 +  
 +  * Done!
 +
 +===== Deadlinks =====
 +
 +After that, you may check your website, mostly dead links with a tool like [[https://radeff.red/dokuwiki/info:softs_linux?#liens_brises_dead_links|linkchecker]]; a dirty solution would be to make a rewriteRule redirecting your old /PreviousSubDirectory/ to the root directory