Live site: https://garrysun.com/
Dev site: https://dev.garrysun.com/
Process:
1. Downloaded copies of site and database.
2. Created a subdomain on my hosting account and pointed it to the dev folder in my root directory.
3. Created a new database and user/pass.
4. Uploaded all files to the new folder and the copy of the database to the new database.
5. Changed the locations in both root and admin config. The http/https URLs are now dev subdomain in the top section and the DIR bottom section shows the location from the root directory up to the dev folder. Database info has also been changed.
6. I cleared cookies and history and hit CTRL +F5 at least 5 times.
How can I get the subdomain to point to itself?
Do I have to change something in the database?
Ernie
Code: Select all
# SEO URL Settings
RewriteEngine On
# If your opencart installation does not run on the main web folder,
# make sure you folder it does run in ie. / becomes /shop/
RewriteBase /shop/
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Code: Select all
# SEO URL Settings
RewriteEngine On
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/
RewriteBase /dev/
Code: Select all
RewriteCond %{HTTP_HOST} ^www\.garrysun\.com [NC]
RewriteRule ^(.*)$ https://garrysun.com/$1 [L,R=301]
Code: Select all
RewriteCond %{HTTP_HOST} ^www\.dev\.garrysun\.com [NC]
RewriteRule ^(.*)$ https://dev.garrysun.com/$1 [L,R=301]
Do you set correctly for store url in admin setting store?
<base href="https://garrysun.com/" />
Ernie
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
I am using version 1.5.4 because the site is old. Part of the need for a dev site is to upgrade it.
The domain I want is https://dev.garrysun.com which is pointing to my root directory (public_html/dev/). I am unsure if the SSL will apply to the subdomain but even if I try without https it doesn't work. I am not sure why the base url shows the actual live site and not the dev site if I have this info installed. I have quadruple checked that the files are uploaded correctly. Could it be something else with the subdomain?
.../config.php
Code: Select all
// HTTP
define('HTTP_SERVER', 'http://dev.garrysun.com/');
define('HTTP_IMAGE', 'http://dev.garrysun.com/image/');
define('HTTP_ADMIN', 'http://dev.garrysun.com/admin/');
// HTTPS
define('HTTPS_SERVER', 'https://dev.garrysun.com/');
define('HTTPS_IMAGE', 'https://dev.garrysun.com/image/');
// DIR
define('DIR_APPLICATION', '/public_html/dev/catalog/');
define('DIR_SYSTEM', '/public_html/dev/system/');
define('DIR_DATABASE', '/public_html/dev/system/database/');
define('DIR_LANGUAGE', '/public_html/dev/catalog/language/');
define('DIR_TEMPLATE', '/public_html/dev/catalog/view/theme/');
define('DIR_CONFIG', '/public_html/dev/system/config/');
define('DIR_IMAGE', '/public_html/dev/image/');
define('DIR_CACHE', '/public_html/dev/system/cache/');
define('DIR_DOWNLOAD', '/public_html/dev/download/');
define('DIR_LOGS', '/public_html/dev/system/logs/');
Code: Select all
// HTTP
define('HTTP_SERVER', 'http://dev.garrysun.com/admin/');
define('HTTP_CATALOG', 'http://dev.garrysun.com/');
define('HTTP_IMAGE', 'http://dev.garrysun.com/image/');
// HTTPS
define('HTTPS_SERVER', 'https://dev.garrysun.com/admin/');
define('HTTPS_CATALOG', 'https://dev.garrysun.com/');
define('HTTPS_IMAGE', 'https://dev.garrysun.com/image/');
// DIR
define('DIR_APPLICATION', '/public_html/dev/admin/');
define('DIR_SYSTEM', '/public_html/dev/system/');
define('DIR_DATABASE', '/public_html/dev/system/database/');
define('DIR_LANGUAGE', '/public_html/dev/admin/language/');
define('DIR_TEMPLATE', '/public_html/dev/admin/view/template/');
define('DIR_CONFIG', '/public_html/dev/system/config/');
define('DIR_IMAGE', '/public_html/dev/image/');
define('DIR_CACHE', '/public_html/dev/system/cache/');
define('DIR_DOWNLOAD', '/public_html/dev/download/');
define('DIR_LOGS', '/public_html/dev/system/logs/');
define('DIR_CATALOG', '/public_html/dev/catalog/');
Code: Select all
// HTTP
define('HTTP_SERVER', 'https://dev.garrysun.com/admin/');
define('HTTP_CATALOG', 'https://dev.garrysun.com/');
define('HTTP_IMAGE', 'https://dev.garrysun.com/image/');
// HTTPS
define('HTTPS_SERVER', 'https://dev.garrysun.com/admin/');
define('HTTPS_CATALOG', 'https://dev.garrysun.com/');
define('HTTPS_IMAGE', 'https://dev.garrysun.com/image/');
related to this.
Ernie
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
for default store (store_id = 0), store url use HTTP_CATALOG as code below:
Code: Select all
$this->data['stores'][] = array(
'store_id' => 0,
'name' => $this->config->get('config_name') . $this->language->get('text_default'),
'url' => HTTP_CATALOG,
'selected' => isset($this->request->post['selected']) && in_array(0, $this->request->post['selected']),
'action' => $action
);
May be you need check database for table setting.
Also make sure you are not change file header.php at catalog/controller/common/header.php
'url' => HTTP_CATALOG,
only, if the HTTP_CATALOG config.php setting is set to HTTPS, as I documented above!
Ernie
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Code: Select all
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
RewriteCond %{HTTP_HOST} ^www\.dev\.garrysun\.com [NC]
RewriteRule ^(.*)$ https://dev.garrysun.com/$1 [L,R=301]
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
I changed the config files to use all https: and not http: in the first few lines.
IP_CAM and opencartboost, I am not sure what you are saying about the store.php file. Do I need to change something there? Mine is the same as the code above. It says it should use HTTP_CATALOG but in the config files HTTP_CATALOG is pointing to the correct url.
If I need to change something in the database where do I change it? Which table? I have searched for the url but it doesn't seem to come up anywhere that is related to the store settings.
uses 'internally' either http or SSL by default. So, whatever call has been done,
it NEEDS to be re-linked to https, by Nature of things.
Just try, what we tell you, before asking questions, you cannot ruin anything!
Ernie
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Admin config.php
Code: Select all
// HTTP
define('HTTP_SERVER', 'https://dev.garrysun.com/admin/');
define('HTTP_CATALOG', 'https://dev.garrysun.com/');
define('HTTP_IMAGE', 'https://dev.garrysun.com/image/');
// HTTPS
define('HTTPS_SERVER', 'https://dev.garrysun.com/admin/');
define('HTTPS_CATALOG', 'https://dev.garrysun.com/');
define('HTTPS_IMAGE', 'https://dev.garrysun.com/image/');
Code: Select all
// HTTP
define('HTTP_SERVER', 'https://dev.garrysun.com/');
define('HTTP_IMAGE', 'https://dev.garrysun.com/image/');
define('HTTP_ADMIN', 'https://dev.garrysun.com/admin/');
// HTTPS
define('HTTPS_SERVER', 'https://dev.garrysun.com/');
define('HTTPS_IMAGE', 'https://dev.garrysun.com/image/');
But also make sure to have set a correct
RewriteBase path set in each of the both .htaccess files,
like:
Code: Select all
RewriteBase /shop/
and:
RewriteBase /dev/
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Code: Select all
# SEO URL Settings
RewriteEngine On
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/
RewriteBase /dev/
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
RewriteCond %{HTTP_HOST} ^www\.dev\.garrysun\.com [NC]
RewriteRule ^(.*)$ https://dev.garrysun.com/$1 [L,R=301]
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteBase path set in each of the both .htaccess files "
Ernie
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Code: Select all
# Use PHP5.4 as default
AddHandler application/x-httpd-php54 .php
The big question is that if the config files are all correct and the htaccess file is correct why do all the links in dev.garrysun.com point back to the live site? Is there a database field that I need to change or should I just set up the dev site in a subfolder like garrysun.com/dev and give up? I really wanted it in the subdomain so it is less likely to be found but users/search engines.
Thanks again, I really appreciate all your tips.
Users browsing this forum: jrr, Majestic-12 [Bot] and 31 guests