Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8576169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:51:57+00:00 2026-06-11T19:51:57+00:00

Even when I am on HTTPS, Magento’s getProductUrl() always seem to return an HTTP

  • 0

Even when I am on HTTPS, Magento’s getProductUrl() always seem to return an HTTP URL. Any ways I can make this auto-switch to HTTPS? (or have it return relative protocol url).

I would say it’s a rather ‘standard’ configuration.

Base URL is http://example.com/

Secure URL is https://example.com/

Use Secure URLs in Frontend is No

Base Link URL is {{unsecure_base_url}}

I am aware I could change the above to {{secure_base_url}} however I do not want to force a change from HTTP to HTTPS, I only need it to stay relative.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T19:51:59+00:00Added an answer on June 11, 2026 at 7:51 pm

    The main Magento’s benefit, is that you can do anything you want with it 🙂 So, yes, you can output HTTPS product urls or relative ones. However, before choosing a solution, let’s consider the Magento authors’ vision.

    The HTTPS for frontend is designed to work only for specific areas like Customer account, Payment methods, Checkout, etc. There is nothing so private about products, which makes it necessary to be viewed via HTTPS as well.

    By default Magento doesn’t use HTTPS even for pages, mentioned above. In order to turn HTTPS on, the “Use Secure URLs in Frontend” option must be set to “Yes”. Which, as described, will engage HTTPS only in limited set of pages that contain some private data.

    So the best solution for you depends on specifics of the store, you are developing.

    1) If you want to engage HTTPS for all the pages on frontend – then the best solution is to put “https://…” into “Base URL” option for “Unsecure” web url configuration.

    2) If you want to turn on HTTPS only for product links and only for a limited number of pages, then you can override templates of that pages in order to put there relative urls. The actual code can be implemented in any way you like, even the simplest already proposed way is ok:

    echo trim($_product->getProductUrl(),'http:')
    

    3) If you want to engage HTTPS for all the product links at frontend – then the best way is to override Mage_Catalog_Module_Product_Url model and change method getUrl() – you need to put there

    $routeParams['_secure'] = true;
    

    This will produce all the product urls with HTTPS protocol.

    4) If you need to show HTTP product links only at HTTP pages and HTTPS product links only at HTTPS pages, then you can use method 3) with a more sophisticated logic: check the protocol of current page before setting ‘_secure’ parameter.

    Hope, it helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How come I can post correctly using https://developers.facebook.com/tools/explorer/ with this url: https://graph.facebook.com/me/og.likes?object=http://guidepal.com/escape/30?access_token=xxx where xxx
I would like to use this script https://github.com/jeromeetienne/jquery-qrcode (or is there even a better
Even .head doesn't work. What changes do I need to make to make this
http://sandbox.jinoh.dk/magento/index.php/ I am sadly a noob with this system. I have a series of
Here I'm referring to http://en.wikipedia.org/wiki/Merge_%28SQL%29 https://stackoverflow.com/a/8553030/304690 offers even a wider list of databases supporting
can the payment callback URL (https) work with self-signed certificate or do I need
Even though it's not part of HTTP 1.1/RFC2616 webapps that wish to force a
Example: http://jqueryui.com/demos/dialog/#modal-confirmation The example shown allows you to view the source and even has
My website at http://derek.genevievehoward.com/ will not display in Firefox, even though the HTML and
I am trying to install Googles' eclipse plugin - http://code.google.com/eclipse/docs/getting_started.html Even on following all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.