Post by debbiekipt » Thu Feb 19, 2015 2:04 am

Hi
Are the links in OC hardcoded?

I a running OC 1.5.5.1 and have been trying to set up a copy site to use for testing as I purchased a theme (Journal) and was advised to test on a copy site first to get the look as I wanted.

After following instructions in the forum, I got the copy site working with the theme installed, BUT only the front page looked as expected, none of the product or image links worked.
All went to my custom 404 page.

After several goes and same result, I then paid my host to do the copy so I could move forward.

They got a similar result, though first the links went to my live site not 404.
After I reported this problem to the host doing the work, they said it was because the links and images are hard coded?

They did also say they changed it in the DB, but the only difference now is links go to my custom 404 page.

Can anyone confirm if the links are hard coded and if so, what is the way to copy a complete working site to use as a test site?

Thanks

Active Member

Posts

Joined
Sun Nov 21, 2010 8:10 pm

Post by kirkhall » Thu Feb 19, 2015 6:59 am

You probably need to check your config.php and admin\config.php and maybe your .htaccess. Make sure they are pointing to the copy of your actual database and that the file paths are correct for the rest.

Active Member

Posts

Joined
Thu May 22, 2014 11:31 am

Post by debbiekipt » Thu Feb 19, 2015 9:10 pm

Thanks Kirkhall
Config files are correct with new location and DB links, but the issue remains, my hosts solution is:

"the problem which is occurring is connected with the store settings and the modules installed, so firstly you should look for solution in OpenCart forums and then you should contact the OpenCart support team."

I uninstalled all extra modules but the issue remains.
I do have multistore set up, could this be an issue?
My host suggested deleting the second store, but I cannot as it has hundreds of orders attached so will not delete from admin.

If it was an OC issue, surely there would be lots of forum posts about it, I found only 1 and their issue appears that the URL in the admin was wrong, mine is correct.

Any ideas anyone?
Thanks

Active Member

Posts

Joined
Sun Nov 21, 2010 8:10 pm

Post by Dhaupin » Fri Feb 20, 2015 5:24 am

Did you use these steps? What forum post are you referring to? We do this sync-to-test-store almost every week.

1) Download the DB using Cpanel or PHPMyAdmin

2) Download all the files in the store

3) Enter the store files and delete the contents of image/cache and system/cache directories

4) Change store/config.php and store/admin/config.php to reflect your new url settings (you MUST set correct absolute paths for the directory defines). Make sure htaccess has correct rewritebase. Upload the store.

5) Upload the database to test area, make sure the credentials and names matches what is in configs

6) Find any settings you need to change or mods to disable in DB settings table

7) Log in, good to go

https://creadev.org | support@creadev.org - Opencart Extensions, Integrations, & Development. Made in the USA.


User avatar
Active Member

Posts

Joined
Tue May 13, 2014 3:45 am
Location - PA

Post by debbiekipt » Fri Feb 20, 2015 11:58 pm

Hi Dhaupin and thanks for your input and confirmation it should be easy!

I followed the instructions at the post below originally:
http://forum.opencart.com/viewtopic.php ... 68#p498996

They are very similar to yours.
I have also set up another test area today following your instructions, but the issue remains, if slightly different.
Now most of the nav (category) links go to 404, product image links go to original live site, account and gift vouchers direct correctly i.e. test site URL in browser bar.

It would seem to me that there is something vital in your step 6 which must be the issue:
6) Find any settings you need to change or mods to disable in DB settings table

But I do not know what to look for, can you expand on this step at all?
I do have several purchased mods active on my live site, do I need to uninstall these in the test site for it to work properly?

Many thanks again

Active Member

Posts

Joined
Sun Nov 21, 2010 8:10 pm

Post by Dhaupin » Sat Feb 21, 2015 1:23 am

Hmm weird. I see his idea is re-running the installer, we usually just drop files in. Maybe there is something in the re-install we are missing. Do your config files have the correct paths? It sounds like your demo install is still trying to use entities from the live install. This could happen if they were installed on the same server

Here is a fake example of a define() line from config.php. Notice the "STORE" dir calling the live store:
define('DIR_APPLICATION', '/home/myaccount/public_html/STORE/catalog/');

In a test store it would be different though. Notice the TEST dir location:
define('DIR_APPLICATION', '/home/myaccount/public_html/TEST/catalog/');


Another thought is the htaccess file -- there is a spot in it for "RewriteBase". Make sure that doesnt point to a real store folder otherwise it may try to pull from that spot instead of the test spot.


For #6, As far as settings go from mods and stuff, you can search the oc_settings table using PHPMyAdmin. If there are any urls set there pointing to the real store, the test store may try to route wrong.

https://creadev.org | support@creadev.org - Opencart Extensions, Integrations, & Development. Made in the USA.


User avatar
Active Member

Posts

Joined
Tue May 13, 2014 3:45 am
Location - PA

Post by debbiekipt » Mon Feb 23, 2015 4:55 pm

Hi Dhaupin
Many thanks for your reply and additional info. and you were right with your htaccess RewriteBase thought.

Victorj also recognised that and kindly fixed it :-)

My original site is in root domain, copy site was in a folder, simply adding that to the RewriteBase was the fix.

I suggest anyone using Compila.com as a host does not employ their 'Installation and troubleshooting' service as they
could not figure this out and told me the issue was in the DB and I should fix it myself!

Many thanks again for your input :-)

Active Member

Posts

Joined
Sun Nov 21, 2010 8:10 pm

Post by IP_CAM » Mon Feb 23, 2015 5:28 pm

Just to mention it, I just moved a Shop, according to this info:

http://cartadvisor.com/blog/2012/02/20/ ... ew-domain/

and it worked without any problem.

http://bigmax.ch/shop/
to:
http://bigmax.ch/cart/

I did not even have to reactivate VqMod or anything...

Ernie

READ my Welcome Text on the Site:
http://bigmax.ch/shop/
to find the Information to your image problem.

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by aus10 » Thu Jun 11, 2015 2:17 am

debbiekipt wrote:Hi Dhaupin
Many thanks for your reply and additional info. and you were right with your htaccess RewriteBase thought.

Victorj also recognised that and kindly fixed it :-)

My original site is in root domain, copy site was in a folder, simply adding that to the RewriteBase was the fix.

I suggest anyone using Compila.com as a host does not employ their 'Installation and troubleshooting' service as they
could not figure this out and told me the issue was in the DB and I should fix it myself!

Many thanks again for your input :-)
I don't even have a .htaccess on my opencart install not sure if thats normal, used to wordpress. Can you post yours or what you added here please. I am having exact same problem

New member

Posts

Joined
Mon Jul 22, 2013 10:48 am

Post by IP_CAM » Thu Jun 11, 2015 11:11 am

the only line, required to be adjusted, is this one:

Code: Select all

RewriteBase /shop/
if you have your Shop placed in another Subdirectory than 'shop'.
paste it on an empty file, opened with NOTEPAD++, or another well done Texteditor,
and save it as

Code: Select all

.htaccess
without a title before the DOT.

Code: Select all

# Rabbit Rabbit Security Upgrade
Options +SymLinksIfOwnerMatch

# Prevent Directoy listing 
Options -Indexes

# Prevent Direct Access to files
<FilesMatch "\.(tpl|ini|log)">
 Order deny,allow
 Deny from all
</FilesMatch>

# SEO URL Settings
RewriteEngine On
RewriteBase /shop/

RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^download/(.*) /index.php?route=error/not_found [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]

### Additional Settings that may need to be enabled for some servers 
### Uncomment the commands by removing the # sign in front of it.
### If you get an "Internal Server Error 500" after enabling any of the following settings, restore the # as this means your host doesn't allow that.

# 1. If your cart only allows you to add one item at a time, it is possible register_globals is on. This may work to disable it:
# php_flag register_globals off

# 2. If your cart has magic quotes enabled, This may work to disable it:
# php_flag magic_quotes_gpc Off

# 3. Set max upload file size. Most hosts will limit this and not allow it to be overridden but you can try
# php_value upload_max_filesize 999M

# 4. set max post size. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value post_max_size 999M

# 5. set max time script can take. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_execution_time 200

# 6. set max time for input to be recieved. Uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_input_time 200

# 7. disable open_basedir limitations
# php_admin_value open_basedir none

# BEGIN Rabbit Rabbit
# Enable Gzip Compression
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

# Remove Browser Bugs
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent

# Leverage Browser Caching
<IfModule mod_expires.c>
 ExpiresActive On
 ExpiresByType image/jpg "access plus 1 week"
 ExpiresByType image/jpeg "access plus 1 week"
 ExpiresByType image/gif "access plus 1 week"
 ExpiresByType image/png "access plus 1 week"
 ExpiresByType text/css "access plus 1 week"
 ExpiresByType application/pdf "access plus 1 week"
 ExpiresByType text/x-javascript "access plus 1 week"
 ExpiresByType application/x-shockwave-flash "access plus 1 week"
 ExpiresByType image/x-icon "access plus 1 week"
 ExpiresDefault "access plus 1 week"
</IfModule>
Good Luck
Ernie
bigmax.ch/os/

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: Bing [Bot] and 76 guests