Skip to content

Custom Admin Domain and Internal Redirects #28943

@pocallaghan

Description

@pocallaghan

The logic that checks if a redirect is "internal" is broken in the admin panel when using a custom admin domain, which causes a wide variety of admin redirects to redirect you to the homepage of the default store.

The issue is due to Magento\Store\App\Response\Redirect::_isUrlInternal using the default stores base url. When in the adminhtml area, this method should respect the config options admin/url/use_custom and admin/url/custom.

Preconditions (*)

  1. Magento 2.4-develop
  2. Custom admin domain set under Stores > Configuration > Advanced > Admin > Admin Base Url > Custom Admin Url
    image
  3. For local environment: Create additional virtualhost for url http://admin.magento2dev.loc and add admin.magento2dev.loc to hosts file
<VirtualHost *:80>
    ServerName          magento2dev.loc
    ServerAlias magento2dev.loc
    DocumentRoot        /var/www/html/magento2dev
<Directory /var/www/html/magento2dev/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
Require all granted
</Directory>
 </VirtualHost>


<VirtualHost *:80>
    ServerName          admin.magento2dev.loc
    DocumentRoot        /var/www/html/magento2dev
<Directory /var/www/html/magento2dev/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
Require all granted
</Directory>
 </VirtualHost>

Steps to reproduce (*)

  1. Log in to an account with access to URL Rewrites
  2. Navigate to Marketing > URL Rewrites
  3. Click Add Url Rewrite
  4. Enter 123456789 as the request path and 987654321 as the target path, then hit save.
  5. Click Add Url Rewrite again
  6. Enter 123456789 as the request path and xyz as the target path, then hit save.

Expected result (*)

  1. Expected to be redirected back to the URL Rewrite Edit page with an error message Request Path for Specified Store already exists.

Actual result (*)

  1. You're redirected to the homepage of the default store.
    Peek 2020-07-07 13-21

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Labels

Component: UrlRewriteFixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: doneReported on 2.4.0Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S1Affects critical data or functionality and forces users to employ a workaround.Triage: DoneHas been reviewed and prioritized during Triage with Product Managers

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions