Is there a way to force all links in the Magento admin area to use www?

We have a site that's been around for a long time and all the frontend URLs are indexed with 'www' at the start.

There were some issues with the htaccess rules which I've now changed to force all paths to have 'www' in and use https.

Now when we use the admin area we cant search any of the grids, we just get an ajax searching wheel and it gets stuck showing just an empty page (with header and footer, the grid just disappears)

If I check in the console it flags a CORS error. I think this is because all the links point to the non www domain instead of the 'www' version.

I tried adding this to the htaccess to allow cross-origin requests but it didn't seem to work.

<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"

So, can anyone tell me which file or DB entry to change to force all the links to use the www version?


Go to System->Configuraiton in the left tab select Web in the unsecured tab add the domain name with www

enter image description here


  • Go to System -> Configuration -> ADVANCED -> Admin -> Admin Base URL
  • Select Use Custom Admin URL as 'Yes'
  • Add full URL to your admin area with www in Custom Admin URL field.

enter image description here

  • Ive already tried that but all the links in admin still dont have the 'www' in. Ive set it with 'www' in default values and website and store view. May 1 '19 at 11:20
  • just updated the answer, did you check that? Even I had the same problem, this solved issue. May 1 '19 at 11:22
  • Sorry, Ive misread your answer, Thanks let me check it works May 1 '19 at 11:22
  • Ive added that and its half worked, it seems to have broken the links in the admin area and removed the double slash and the colon from the URL and replaced with a . so my links are now https.domain.com/folder/. I put the full url in the custom url field. May 1 '19 at 12:00
  • Which field you filled Custom Admin URL? May 1 '19 at 12:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.