Zen Cart Logo
Forums / Upgrading to 1.5.x / Admin login leading to myadmin/ instead od myadmin/index.php

Admin login leading to myadmin/ instead od myadmin/index.php

Views: 1,800

Results 1 to 8 of 8
16 Feb 2022, 8:45 AM
#1
istilah avatar

istilah

New Zenner

Join Date:
Jan 2006
Location:
Netherlands
Posts:
48
Plugin Contributions:
0

Admin login leading to myadmin/ instead od myadmin/index.php

Finally make some time for upgrading from 1.56C to 1.57C. Using PHP7.4.27

After upgrade the admin login leads me to myadmin/ instead of myadmin/index.php, after giving my credentials. myadmin/ leads me to the shopfront page.
I can manually type index.php after the URL and I get to the correct admin indexpage. Also the toplogo goes to myadmin/ instead of myadmin/index.php.
The language changer in the header is also acting the same wrong way, but only on the admin indexpage.

Diving into the code of the admin header I find a FILENAME_DEFAULT which IS indeed defined in the file includes/filenames.php. But the admin does not seem to find it. The rest of the admin seems to be working fine.

When I place a second and vanilla admin directory myadmin2 it works the same wrong way, so the culprit is not in the admin directory, but must be somewhere in the includes directory. I haven't got a clue where to find it. I tried changing .htaccess because of CEON, but I can not imagine any other plugin having anything to do with it.

Anybody any ideas where to look? I am getting dizzy finding the cause of this bug.

Thanks,
Ronald

16 Feb 2022, 8:55 PM
#2
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,763
Plugin Contributions:
9

Re: Admin login leading to myadmin/ instead od myadmin/index.php

Probably a missing or added-when-not-needed / on the end of a link in the admin's configure.php file.

16 Feb 2022, 8:56 PM
#3
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Admin login leading to myadmin/ instead od myadmin/index.php

I've seen the same issue, when the site's installed in a subdirectory and Ceon URI Mappings are in use. I've tried (with no avail) to correct the issue.

17 Feb 2022, 3:05 AM
#4
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Admin login leading to myadmin/ instead od myadmin/index.php

And I've "resolved" such an issue for a sub-directory installed site through the following .htaccess content that is placed at the root of the domain name where below I show that there are at least 3 sub-directories off of the one domain name where most if not all use the Ceon URI software:

# The next line is required to be present only one time in this file at or above the next liine:
RewriteEngine on

## BEGIN CEON URI MAPPING REWRITE RULE

# ONLY rewrite URIs beginning with sub-directory1 /sub-directory1/
RewriteCond %{REQUEST_URI} ^/sub-directory1/ [NC]
RewriteCond %{REQUEST_URI} !^/sub-directory2 [NC]
RewriteCond %{REQUEST_URI} !^/sub-directory2/ [NC]
RewriteCond %{REQUEST_URI} !^/sub-directory3 [NC]
RewriteCond %{REQUEST_URI} !^/sub-directory3/ [NC]
# Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])
RewriteCond %{REQUEST_URI} !\.[a-z]{2,5}$ [NC]
# Don't rewrite any URIs for some, popular specific file format extensions,
#   which are not covered by main file extension condition above
RewriteCond %{REQUEST_URI} !\.(mp3|mp4|h264|woff2)$ [NC]
# Don't rewrite admin directory
RewriteCond %{REQUEST_URI} !^/sub-directory1/YOUR_ADMIN [NC]
# Don't rewrite editors directory
RewriteCond %{REQUEST_URI} !^/sub-directory1/editors/ [NC]
# Don't rewrite logs directory
RewriteCond %{REQUEST_URI} !^/sub-directory1/logs/ [NC]
# Don't rewrite zc_plugins directory
RewriteCond %{REQUEST_URI} !^/sub-directory1/zc_plugins/ [NC]
# Don't rewrite zc_install directory Needed during upgrade but should be removed or commented in operation.
#RewriteCond %{REQUEST_URI} !^/sub-directory1/zc_install/ [NC]
# Handle all other URIs using Zen Cart (its index.php)
RewriteRule .* sub-directory1/index.php [QSA,L]

## END CEON URI MAPPING REWRITE RULE

I have a similar rule setup for each of the sub-directories used and each excludes the sub-directory of the other(s). I might be able to trim the above down some but haven't really cared to spend the time. I used to store a similar rule in the sub-directory of the site in the sub-directory, but the above works better and is easier.

Different sites/servers also may require some variation of the above.

17 Feb 2022, 9:49 AM
#5
istilah avatar

istilah

New Zenner

Join Date:
Jan 2006
Location:
Netherlands
Posts:
48
Plugin Contributions:
0

Re: Admin login leading to myadmin/ instead od myadmin/index.php

Solved!
Thank you all, I inspected the configure.php and .htaccess again on your advice and found a typo in the admin name of the configure.php I completely overlooked.
Thanks again!

Ronald

17 Feb 2022, 11:16 AM
#6
istilah avatar

istilah

New Zenner

Join Date:
Jan 2006
Location:
Netherlands
Posts:
48
Plugin Contributions:
0

Re: Admin login leading to myadmin/ instead od myadmin/index.php

Correction, typo in admin name the .htaccess.

17 Feb 2022, 11:28 AM
#7
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Admin login leading to myadmin/ instead od myadmin/index.php

mc12345678:

And I've "resolved" such an issue for a sub-directory installed site through the following .htaccess content that is placed at the root of the domain name where below I show that there are at least 3 sub-directories off of the one domain name where most if not all use the Ceon URI software:

The next line is required to be present only one time in this file at or above the next liine:

RewriteEngine on

BEGIN CEON URI MAPPING REWRITE RULE

ONLY rewrite URIs beginning with sub-directory1 /sub-directory1/

RewriteCond %{REQUEST_URI} ^/sub-directory1/ [NC]
RewriteCond %{REQUEST_URI} !^/sub-directory2 [NC]
RewriteCond %{REQUEST_URI} !^/sub-directory2/ [NC]
RewriteCond %{REQUEST_URI} !^/sub-directory3 [NC]
RewriteCond %{REQUEST_URI} !^/sub-directory3/ [NC]

Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])

RewriteCond %{REQUEST_URI} !.[a-z]{2,5}$ [NC]

Don't rewrite any URIs for some, popular specific file format extensions,

which are not covered by main file extension condition above

RewriteCond %{REQUEST_URI} !.(mp3|mp4|h264|woff2)$ [NC]

Don't rewrite admin directory

RewriteCond %{REQUEST_URI} !^/sub-directory1/YOUR_ADMIN [NC]

Don't rewrite editors directory

RewriteCond %{REQUEST_URI} !^/sub-directory1/editors/ [NC]

Don't rewrite logs directory

RewriteCond %{REQUEST_URI} !^/sub-directory1/logs/ [NC]

Don't rewrite zc_plugins directory

RewriteCond %{REQUEST_URI} !^/sub-directory1/zc_plugins/ [NC]

Don't rewrite zc_install directory Needed during upgrade but should be removed or commented in operation.

#RewriteCond %{REQUEST_URI} !^/sub-directory1/zc_install/ [NC]

Handle all other URIs using Zen Cart (its index.php)

RewriteRule .* sub-directory1/index.php [QSA,L]

END CEON URI MAPPING REWRITE RULE

> 
> I have a similar rule setup for each of the sub-directories used and each excludes the sub-directory of the other(s). I might be able to trim the above down some but haven't really cared to spend the time. I used to store a similar rule in the sub-directory of the site in the sub-directory, but the above works better and is easier.
> 
> Different sites/servers also may require some variation of the above.
So, leaving that trailing **/** off the admin directory condition should "do the trick"?
17 Feb 2022, 12:40 PM
#8
istilah avatar

istilah

New Zenner

Join Date:
Jan 2006
Location:
Netherlands
Posts:
48
Plugin Contributions:
0

Re: Admin login leading to myadmin/ instead od myadmin/index.php

No, it was not the trailing /, but I renamed the admin to number (a date) and mistyped the name in the .htaccess.