cancel
Showing results for 
Search instead for 
Did you mean: 

admin url is redirected to a wrong url

admin url is redirected to a wrong url

Hi, all,

 

when I type https://shop.xxx.us/admin_rsd9od/

the browser redirects to https://shop.xxx.usadmin_rsd9od/  

Is this because the apache config is wrong? How do I fix this problem? Thanks         

9 REPLIES 9

Re: admin url is redirected to a wrong url

Hi @mariolzx,

Please make sure that you have added weburl properly in database.

https://shop.innob.us/

“/“ in the trail.

Flush cache and try once.

Re: admin url is redirected to a wrong url

Thanks. Could you tell me where in the database? like which table? Thanks

Re: admin url is redirected to a wrong url

Table: core_config_data

To select rows sql query:

Select * from core_config_ data where path like ‘%web_url%’;

Re: admin url is redirected to a wrong url

Hi,

I just checked the core_config_ data table and it has 36 rows right now. The columns are :

config_id | scope | scope_id | path | value

 

Do you mean it should be 37|default|0|web_url|https://shop.xxx.us/

 

Thanks

Re: admin url is redirected to a wrong url

Yes, I am referring for the same.

If there are any other rows like unsecure and secure url then update them as well.

Re: admin url is redirected to a wrong url

INSERT INTO core_config_data(config_id, scope, scope_id, path, value) VALUES (37, 'default', 0, 'admin/url/custom', 'https://shop.xxx.us/admin_rsd9od/'); I used this sentence to solve my problem. I did not try your solution, so I don't know whether it will work. However, why couldn't Magento installation handle this correctly by default? Why do we have to add this row to the database? Is there anything I did wrong in my installation? Thanks

Re: admin url is redirected to a wrong url

Good to hear that problem solved.

It will also work.

The solution you tried add new entry when you add admin url using magento admin panel. It overrides the admin path which we declare in the app/etc/env.php file.

You Magento installation is looks fine. There was some issue with web urls which I mentioned earlier in my comment.

Re: admin url is redirected to a wrong url

Hi @mariolzx 

 

The query you have used to resolve this issue is for insert a new entry - basically this is row is auto-generated when we installed new Magento.

 

On the installation setup it gives us option to choose the admin URL - so if we select at that time then these row will add in the core_config_table.

 

So manually it is not require to add - but here in your case there might be issue happen on installation level or may be some confliction happen due to that it is not there and you have to inserted manually.

 

Anyways the query you have run is correct and solution is also correct.

 

Hope it helps !

if issue solved,Click Kudos & Accept as Solution

Re: admin url is redirected to a wrong url


@Vimal Kumar wrote:
Hi @mariolzx,

Please make sure that you have added weburl properly in database.

https://shop.innob.us/

“/“ in the trail.

Flush cache and try once.

I had an err_invalid_redirect on the admin page and none of the answers here nor SO addressed this specific problem. Added a "/" at the end of every web/secure/base_url and web/unsecure/base_url record in the database, cleared the cache, restarted the server and this fixed my problem.