Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Admin page redirect-trouble Rate Topic   - - - - -

 

Posted 26 August 2013 - 09:50 AM #1

Hi CS-Cart experts.

I've just copied my live-shop to a test-shop on my server, for development.

I copied all the files and sql files for at total identical site, on a sub-domain. I changed the config.local.php for my new database informations, new site-name, altered the backend file name.

When launching my test-shop on the subdomain, everything is OK. But when i enter the admin page, for some reason it redirects the page to the live-shop url instead?

I've tried to ?cc the page, no results.
Double checked the $config['https_host'] so it has the sub-domain
Rewrite engine on and off in the .htaccess

When checking the http header status, it says 302 to exact same adresse.

Does anyone have an idea, where my problem is?

Live shop: www.sengeepxerten.dk
Test shop: www.closed.sengeexperten.dk

Thanks in advance,
Jesper.

 
  • johnbol1
  • Never Re
  • Members
  • Join Date: 23-Feb 10
  • 4917 posts

Posted 26 August 2013 - 02:21 PM #2

Rewrite base/folder site name

Maybe

Custom printed hi visibility clothing sale the UK's online hivis safety shop
v4.5.2


 

Posted 26 August 2013 - 05:43 PM #3

Hi Johnbol1, can you specify what you mean with that?

Jesper.

 
  • StellarBytes
  • Senior Member
  • Members
  • Join Date: 08-Aug 11
  • 1807 posts

Posted 26 August 2013 - 06:22 PM #4

As per the notes in the .htaccess file:-

# Some hostings require RewriteBase to be uncommented
# Example:
# Your store url is http://www.yourcompany.com/store/cart
# So "RewriteBase" should be:
# RewriteBase /store/cart
# RewriteBase /


Your subdomain will be in a folder such as /devstore/, therefore uncomment the last line in the above to read:-
RewriteBase /devstore
Hire StellarBytes for CS-Cart Design & Development Services

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12051 posts

Posted 27 August 2013 - 05:08 AM #5

What version and what edition? If you are running Ultimate (V3 or V4) you will probably have to edit the database to change the admin url to the new domain. Should be a column in cscart_companies I think.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 

Posted 28 August 2013 - 05:05 PM #6

The rewrite base didn't do the trick :(

I'm running V3, and if I search my db trough for "sengeexperten.dk", it only finds static names and such, no redirects :(

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12051 posts

Posted 28 August 2013 - 06:54 PM #7

it only finds static names and such

what does that mean? Are you meaning that it is only embedded within descriptions and other "content" but is not seen as any column value? What was the actual search string you used in the LIKE query?

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • StellarBytes
  • Senior Member
  • Members
  • Join Date: 08-Aug 11
  • 1807 posts

Posted 28 August 2013 - 09:42 PM #8

Tony is correct on this one, the cscart_companies table is only populated if you are running Ultimate with 2+ stores and does need to be updated if you copy the live store to a development directory. As far as I'm aware, you don't need to do anything to the database for a Pro install, only Ultimate. I just searched the database for "LIKE %adminloginurl%" (where admin URL is domain.com/adminloginurl) and found nothing.

I actually have a V3 store I am working on just now which is running V3 Pro, and I'm working on the development site, the only changes required from copying the live store from the root to /development/ folder were:-

In /development/.htaccess
RewriteBase /development

In /development/config.local.php
$config['http_host'] = 'domain.com/development/';

Via FTP, delete:-
/development/var/cache/ (all contents/subdirectories)

Load domain.com/development/adminurl.php

If you still have the redirect loop, try another web browser or clear your browsers cache.
Hire StellarBytes for CS-Cart Design & Development Services

 

Posted 31 August 2013 - 10:16 PM #9

Thanks for your input StellarBytes.

Unfortunately it didn't solve my problem.

I'm starting get a bit frustrated since I cannot figure out where to root of this problem is located. When running a search in my db for adminloginurl, nothing is returned.

I've tried to fool around with $config['http_host'] only making me more confused.

My dev-store is located on a subfolder named /closed.
When changing my local.config for:
$config['http_host'] = 'www.sengeexperten.dk/closed/';
and visiting my storefront, the page is redirected for the live-store domain, sengeexperten.dk

When visiting dev-store adminpage, I'm stuck in a redirect loop looking something like this:
http://www.sengeexpe...ed/adminurl.php

Next up i tried altering my local.config file like this:
$config['http_host'] = 'www.sengeexperten.dk';
$config['http_path'] = '/closed';
- even if it didn't make a lot of sense, since the installation is running on sengeexperten.dk/closed, the storefront is now staying at the same domain name.
BUT - when entering dev-store admin page, and log-in, i get redirected to the login-page once again.

If anyone can bring some light to this problem, or even give me a hint where to start looking, it would be deeply appreciated - this is really grinding my gears.

Jesper.

***** Update *****

I emptied the row named cscart_stored_session and when running with local.config-configuration:
$config['http_host'] = 'www.sengeexperten.dk';
$config['http_path'] = '/closed';
I am now able to log-in to my backend. My SEO-addon is a wreck, but at least I can log-in :)

I will be updating this article as soon, everything is working!

 
  • StellarBytes
  • Senior Member
  • Members
  • Join Date: 08-Aug 11
  • 1807 posts

Posted 31 August 2013 - 10:55 PM #10

Yep, forgot about the stored sessions table, if anybody else comes across this irritating admin login URL redirection, a quick and easy way to get in is by using the non-SEO URL:-
http://www.yourstore.com/youradmin.php?dispatch=auth.login_form&return_url=admin.php

Hire StellarBytes for CS-Cart Design & Development Services

 
  • EagleRose
  • Member
  • Members
  • Join Date: 21-Feb 07
  • 63 posts

Posted 09 November 2013 - 10:39 PM #11

After beating my head against the wall over this for several hours. The answer was staring at me the whole time.

After changing the :
$config['http_host'] = 'your.domain.com';
and
$config['https_host'] = 'your.domain.com';

Make sure you change the path as well:
// Names of index files for the frontend and backend
$config['customer_index'] = '/dev/index.php';
$config['admin_index'] = '/dev/secretadmin.php';

That fixed it for me - Ver 4.01
Eagle Rose Lingerie
"Bringing Spice to Your Life"
www.eagleroselingerie.com

1.34 sp2

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12051 posts

Posted 10 November 2013 - 07:04 PM #12

You shouldn't have to put the path in the index indicies. You should only have ot make $config['http_path'] = '/dev';

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • stuball
  • Newbie
  • Trial users
  • Join Date: 04-Oct 13
  • 4 posts

Posted 07 June 2015 - 05:35 PM #13

Should someone stumble upon this topic, I discovered a solution, inspired by the suggestions here, that may work for you.

As with the original poster, I copied my site files and database from a development server to a production server and ran into the infinite admin redirect loop issue.

For me it was a cache issue but removing the files from var/cache did not fix the issue. Instead, in config.local.php, I changed the line

$config['cache_backend'] = 'file';

to

$config['cache_backend'] = 'database';

I then navigated to the admin page and logged on successfully.

Once logged in I changed the line back to 'file' (choose the cache method best for your application) and then clicked on Administration | Storage | Clear Cache.

Presumably this decoupled me from some leftover cache asset, allowing me to log in, then having restored the cache method and clearing the cache, returned things to the original state.

One last reminder - for myself as much as anyone else - next time, before copying your development instance over, try clearing the cache first.