News:

Support the VirtueMart project and become a member

Main Menu

site backup redirect to production website

Started by pellegrinoL, July 02, 2020, 10:01:40 AM

Previous topic - Next topic

pellegrinoL

Hi all,

In order to test some stuffs on my website, I have created a backup and installed in a subfolder, but If I order or I want to see may order page, the backup site redirect me to the prodution one.

I have used a different database with different name, and added the new path to all folrder, but for sure I forgot somenthing.. How may I check what I missed?

Best

pinochico

live site in configuration.php
redirect in httacess
?

We don't use subfolder, any time we use another domain.
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

nehakakar

Check all relevant configuration files in configuration.php. it it properly updated with the new database details, site URL, and other relevant information. Check that the configuration files in the backup subfolder are correctly reflecting the subfolder's settings. if not try this way.
This is sample .htaccess code that might help resolve the redirection issue when you're testing your backup site in a subfolder.
Please note that the code provided is a general example, and you should carefully review and adjust it to match your specific setup.
# .htaccess for Testing Backup Site in Subfolder

# Enable Rewrite Engine
RewriteEngine On
RewriteBase /

# Redirect to HTTPS (if needed)
# RewriteCond %{HTTPS} off
# RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Redirect to Subfolder for Testing
RewriteCond %{REQUEST_URI} !^/subfolder/
RewriteRule ^(.*)$ /subfolder/$1 [L]

# Redirect Non-www to www (if needed)
# RewriteCond %{HTTP_HOST} !^www\. [NC]
# RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Joomla SEF URLs
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/subfolder/index\.php
RewriteCond %{REQUEST_URI} (/[^.]*|\.(php|html?|feed|pdf|raw))$ [NC]
RewriteRule ^(.*)$ /subfolder/index.php [L]


1. RewriteEngine On should be enables the Apache rewrite engine.
2. Sets the RewriteBase / for relative path references.
3. The rule redirects all requests to the /subfolder/ directory. Replace subfolder.
4. Joomla SEF URLs are specific to Joomla and ensure that URLs are rewritten for Joomla's SEF (Search Engine Friendly) URLs.
5. If you want to force HTTPS, uncomment these lines and adjust them as needed.
6. If you want to redirect non-www URLs to www, uncomment these lines and adjust them as needed.

Use browser developer tools to inspect network requests and redirects or use this tool Redirect checker This can help you identify where the redirection is happening and potentially trace it back to the source.

lumis

Quote from: pellegrinoL on July 02, 2020, 10:01:40 AM
but If I order or I want to see may order page, the backup site redirect me to the prodution one.
From memory, this happens if you do not update the SHOP vendor URL
Go to Virtuemart/Shop and in the Vendor tab make sure your URL ios set to the test site.
This will stop you seeing the production site but being redirtected to the live site when you go to checkout or other shop functions