How do I change the domain for my JScms installation?
avatar
Señor FAQ

¡Hola, amigos! I’m Señor FAQ, the mustached maestro of questions and answers! With my trusty glasses and a book of endless wisdom, I turn dudas into solutions. Soy el héroe de los curiosos and the champion of clarity.


How to Change the Domain for JScms

Changing the domain for your JScms installation involves updating the domain settings in your database and ensuring your server configuration is updated. Follow these steps to change the domain:

Step-by-Step Guide

  1. Backup Your Database: Before making changes, create a backup of your database to prevent data loss.
  2. Update the Domain in the Database: Use the following SQL query to update all instances of your old domain in the database:

SQL Query Example


-- Update domain in jscms_pages table
UPDATE jscms_pages 
SET content = REPLACE(content, 'https://old-domain.com', 'https://new-domain.com'),
    page_css = REPLACE(page_css, 'https://old-domain.com', 'https://new-domain.com'),
    page_javascript = REPLACE(page_javascript, 'https://old-domain.com', 'https://new-domain.com');

-- Update domain in news table
UPDATE jscms_news 
SET content = REPLACE(content, 'https://old-domain.com', 'https://new-domain.com'),
    news_css = REPLACE(news_css, 'https://old-domain.com', 'https://new-domain.com'),
    news_javascript = REPLACE(news_javascript, 'https://old-domain.com', 'https://new-domain.com');
    

Adjust the table and column names to match your database structure. Replace old-domain.com with your current domain and new-domain.com with the new domain. You might need to do this for other tables as well, if you have installed plugins.

  1. Update Configuration Files: Open the configuration file include/db.php and update the BASE_URL settings.
  2. Update Server Settings: Configure your new domain in your web server (e.g., Apache or Nginx) to point to your JScms installation directory.
  3. Clear Cache: Clear your site and browser cache to ensure the changes take effect.
  4. Test Your Site: Visit your new domain and check for functionality. Ensure that all links and resources load correctly.

Important Notes

  • SSL Certificate: Make sure to install an SSL certificate on the new domain.
  • SEO Considerations: Set up 301 redirects from the old domain to the new domain to maintain SEO rankings.
  • Multilingual Sites: For multilingual sites, ensure all language-specific settings are updated.

With these steps, your JScms installation will be successfully transferred to the new domain.

Was this article helpful?
0 out of 0 found this helpful