Admin page redirect-trouble

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.

Rewrite base/folder site name



Maybe

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



Jesper.

As per the notes in the .htaccess file:-

[quote]# 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 /[/quote]


Your subdomain will be in a folder such as /devstore/, therefore uncomment the last line in the above to read:-
RewriteBase /devstore

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.

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 :(

[quote]

it only finds static names and such

[/quote]

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?

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.

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/';
```<br />
and visiting my storefront, the page is redirected for the live-store domain, sengeexperten.dk<br />
<br />
When visiting dev-store adminpage, I'm stuck in a redirect loop looking something like this:<br />
[url="http://www.sengeexperten.dk/closed//closed/closed/closed/closed/closed/closed/closed/closed/closed/closed/closed/closed/closed/closed/closed/closed/adminurl.php"]http://www.sengeexpe...ed/adminurl.php[/url]<br />
<br />
Next up i tried altering my local.config file like this:<br />
```php
<br />
$config['http_host'] = 'www.sengeexperten.dk';<br />
$config['http_path'] = '/closed';
```<br />
- 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.<br />
BUT - when entering dev-store admin page, and log-in, i get redirected to the login-page once again.<br />
<br />
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.<br />
<br />
Jesper.<br />
<br />
***** Update *****<br />
<br />
I emptied the row named [b]cscart_stored_session [/b]and when running with local.config-configuration:<br />
```php
<br />
$config['http_host'] = 'www.sengeexperten.dk';<br />
$config['http_path'] = '/closed';
```<br />
I am now able to log-in to my backend. My SEO-addon is a wreck, but at least I can log-in <img src="upload://rA9Qa8gnUPZzRZRdI8kt3dpjkrs.png" class="bbc_emoticon" alt=":)"><br />
<br />
I will be updating this article as soon, everything is working!

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

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

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

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.