Magento 2.2.8 - sitemap.xml contains “pub” DIR in the URL, it should be without “pub” directory in the URLWant to remove a specific url from Magento sitemap.xml?Magento 2 multi Store issueMagento Multi Store with multiple domainsHow to remove image url from sitemap.xml Magento 2?Issue with Authorized.net with Magento2.2.5ERR_CONNECTION_REFUSED after Magento2 Migration to Google CloudMagento 2 static files are not being loaded after enabling HTTPSMagento 2.1.3 Build multiple store views with unique subdomains pull CSS and JS from parent website URL?Site maps are being generated automatically with /pub/media in the URL giving 404 errorsMagento 2.2.8 - Has Magento removed the Company field from the checkout?

Quick destruction of a helium filled airship?

What should I do if actually I found a serious flaw in someone's PhD thesis and an article derived from that PhD thesis?

What was the intention with the Commodore 128?

Vector field Stream?

How do ultra-stable oscillators for spacecraft work?

What's the relationship betweeen MS-DOS and XENIX?

Is there a fallacy about "appeal to 'big words'"?

The space of cusp forms for GL_2 over F_q(T)

Output the list of musical notes

Is there any official ruling on how characters go from 0th to 1st level in a class?

Can anybody tell me who this Pokemon is?

What is the opposite of "hunger level"?

Minimum population for language survival

Select elements of a list by comparing it to another list

Have there ever been other TV shows or Films that told a similiar story to the new 90210 show?

If a person claims to know anything could it be disproven by saying 'prove that we are not in a simulation'?

Does writing regular diary entries count as writing practice?

6502: is BCD *fundamentally* the same performance as non-BCD?

Is Fourier series a sampled version of Fourier transform?

What would cause a nuclear power plant to break down after 2000 years, but not sooner?

Will some rockets really collapse under their own weight?

Is a USB 3.0 device possible with a four contact USB 2.0 connector?

Would molten tin solidify and coat an organic horn?

Set theory with antielements?



Magento 2.2.8 - sitemap.xml contains “pub” DIR in the URL, it should be without “pub” directory in the URL


Want to remove a specific url from Magento sitemap.xml?Magento 2 multi Store issueMagento Multi Store with multiple domainsHow to remove image url from sitemap.xml Magento 2?Issue with Authorized.net with Magento2.2.5ERR_CONNECTION_REFUSED after Magento2 Migration to Google CloudMagento 2 static files are not being loaded after enabling HTTPSMagento 2.1.3 Build multiple store views with unique subdomains pull CSS and JS from parent website URL?Site maps are being generated automatically with /pub/media in the URL giving 404 errorsMagento 2.2.8 - Has Magento removed the Company field from the checkout?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















Preconditions




app/etc/env.php




'directories' => [ 'document_root_is_pub' => true ],

'MAGE_MODE' => 'production',



  • document_root_is_pub is true


  • MAGE_MODE is have production value


sitemap.xml




  • Filename : sitemap.xml

  • Path : /media/


Admin => Stores => Configuration => General => Web:




  • Base Urls => Base URL for User Media Files =>unsecure_base_urlmedia/


  • Base URLs (Secure) => Secure Base URL for User Media Files => secure_base_urlmedia/





But while generating the sitemap.xml




Expected result



  • sitemap.xml index urls to sitemap should be
    https://magento-site/media/sitemap-1-1.xml

Actual result



  • Sitemap.xml urls look like
    https://magento-site/pub/media/sitemap-1-1.xml


NOTE : I have generated the sitemap from admin panel.




Any solution or advise will be really helpful.










share|improve this question





















  • 1





    Please set 'MAGE_MODE' to production in env.php file. 'MAGE_MODE' => 'production'.

    – Sunny Rahevar
    Aug 5 at 9:58











  • Hello @SunnyRahevar Thanks for your reply I have checked MAGE_MODE and it is already 'MAGE_MODE' => 'production',

    – Aditya Shah
    Aug 5 at 10:01

















1















Preconditions




app/etc/env.php




'directories' => [ 'document_root_is_pub' => true ],

'MAGE_MODE' => 'production',



  • document_root_is_pub is true


  • MAGE_MODE is have production value


sitemap.xml




  • Filename : sitemap.xml

  • Path : /media/


Admin => Stores => Configuration => General => Web:




  • Base Urls => Base URL for User Media Files =>unsecure_base_urlmedia/


  • Base URLs (Secure) => Secure Base URL for User Media Files => secure_base_urlmedia/





But while generating the sitemap.xml




Expected result



  • sitemap.xml index urls to sitemap should be
    https://magento-site/media/sitemap-1-1.xml

Actual result



  • Sitemap.xml urls look like
    https://magento-site/pub/media/sitemap-1-1.xml


NOTE : I have generated the sitemap from admin panel.




Any solution or advise will be really helpful.










share|improve this question





















  • 1





    Please set 'MAGE_MODE' to production in env.php file. 'MAGE_MODE' => 'production'.

    – Sunny Rahevar
    Aug 5 at 9:58











  • Hello @SunnyRahevar Thanks for your reply I have checked MAGE_MODE and it is already 'MAGE_MODE' => 'production',

    – Aditya Shah
    Aug 5 at 10:01













1












1








1








Preconditions




app/etc/env.php




'directories' => [ 'document_root_is_pub' => true ],

'MAGE_MODE' => 'production',



  • document_root_is_pub is true


  • MAGE_MODE is have production value


sitemap.xml




  • Filename : sitemap.xml

  • Path : /media/


Admin => Stores => Configuration => General => Web:




  • Base Urls => Base URL for User Media Files =>unsecure_base_urlmedia/


  • Base URLs (Secure) => Secure Base URL for User Media Files => secure_base_urlmedia/





But while generating the sitemap.xml




Expected result



  • sitemap.xml index urls to sitemap should be
    https://magento-site/media/sitemap-1-1.xml

Actual result



  • Sitemap.xml urls look like
    https://magento-site/pub/media/sitemap-1-1.xml


NOTE : I have generated the sitemap from admin panel.




Any solution or advise will be really helpful.










share|improve this question
















Preconditions




app/etc/env.php




'directories' => [ 'document_root_is_pub' => true ],

'MAGE_MODE' => 'production',



  • document_root_is_pub is true


  • MAGE_MODE is have production value


sitemap.xml




  • Filename : sitemap.xml

  • Path : /media/


Admin => Stores => Configuration => General => Web:




  • Base Urls => Base URL for User Media Files =>unsecure_base_urlmedia/


  • Base URLs (Secure) => Secure Base URL for User Media Files => secure_base_urlmedia/





But while generating the sitemap.xml




Expected result



  • sitemap.xml index urls to sitemap should be
    https://magento-site/media/sitemap-1-1.xml

Actual result



  • Sitemap.xml urls look like
    https://magento-site/pub/media/sitemap-1-1.xml


NOTE : I have generated the sitemap from admin panel.




Any solution or advise will be really helpful.







magento2 sitemaps magento2.2.8 webroot






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 5 at 10:34







Aditya Shah

















asked Aug 5 at 9:48









Aditya ShahAditya Shah

5,1172 gold badges12 silver badges45 bronze badges




5,1172 gold badges12 silver badges45 bronze badges










  • 1





    Please set 'MAGE_MODE' to production in env.php file. 'MAGE_MODE' => 'production'.

    – Sunny Rahevar
    Aug 5 at 9:58











  • Hello @SunnyRahevar Thanks for your reply I have checked MAGE_MODE and it is already 'MAGE_MODE' => 'production',

    – Aditya Shah
    Aug 5 at 10:01












  • 1





    Please set 'MAGE_MODE' to production in env.php file. 'MAGE_MODE' => 'production'.

    – Sunny Rahevar
    Aug 5 at 9:58











  • Hello @SunnyRahevar Thanks for your reply I have checked MAGE_MODE and it is already 'MAGE_MODE' => 'production',

    – Aditya Shah
    Aug 5 at 10:01







1




1





Please set 'MAGE_MODE' to production in env.php file. 'MAGE_MODE' => 'production'.

– Sunny Rahevar
Aug 5 at 9:58





Please set 'MAGE_MODE' to production in env.php file. 'MAGE_MODE' => 'production'.

– Sunny Rahevar
Aug 5 at 9:58













Hello @SunnyRahevar Thanks for your reply I have checked MAGE_MODE and it is already 'MAGE_MODE' => 'production',

– Aditya Shah
Aug 5 at 10:01





Hello @SunnyRahevar Thanks for your reply I have checked MAGE_MODE and it is already 'MAGE_MODE' => 'production',

– Aditya Shah
Aug 5 at 10:01










1 Answer
1






active

oldest

votes


















1














sometime problem happens when running the sitemap generation through bin/magento cron:run from outside of the magento directory.



  • e.g our magento code is in /var/www/src, if I run php src/bin/magento cron:run from /var/www the urls will contain src as part of the
    baseurl.

  • Running from the magento directory, e.g php bin/magento cron:run from
    /var/www/src, works as expected.

  • Running from ADMIN UI - Site generate will also works as expected.





share|improve this answer





























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "479"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f284414%2fmagento-2-2-8-sitemap-xml-contains-pub-dir-in-the-url-it-should-be-without%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    sometime problem happens when running the sitemap generation through bin/magento cron:run from outside of the magento directory.



    • e.g our magento code is in /var/www/src, if I run php src/bin/magento cron:run from /var/www the urls will contain src as part of the
      baseurl.

    • Running from the magento directory, e.g php bin/magento cron:run from
      /var/www/src, works as expected.

    • Running from ADMIN UI - Site generate will also works as expected.





    share|improve this answer































      1














      sometime problem happens when running the sitemap generation through bin/magento cron:run from outside of the magento directory.



      • e.g our magento code is in /var/www/src, if I run php src/bin/magento cron:run from /var/www the urls will contain src as part of the
        baseurl.

      • Running from the magento directory, e.g php bin/magento cron:run from
        /var/www/src, works as expected.

      • Running from ADMIN UI - Site generate will also works as expected.





      share|improve this answer





























        1












        1








        1







        sometime problem happens when running the sitemap generation through bin/magento cron:run from outside of the magento directory.



        • e.g our magento code is in /var/www/src, if I run php src/bin/magento cron:run from /var/www the urls will contain src as part of the
          baseurl.

        • Running from the magento directory, e.g php bin/magento cron:run from
          /var/www/src, works as expected.

        • Running from ADMIN UI - Site generate will also works as expected.





        share|improve this answer















        sometime problem happens when running the sitemap generation through bin/magento cron:run from outside of the magento directory.



        • e.g our magento code is in /var/www/src, if I run php src/bin/magento cron:run from /var/www the urls will contain src as part of the
          baseurl.

        • Running from the magento directory, e.g php bin/magento cron:run from
          /var/www/src, works as expected.

        • Running from ADMIN UI - Site generate will also works as expected.






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Aug 5 at 12:00

























        answered Aug 5 at 11:55









        Aditya ShahAditya Shah

        5,1172 gold badges12 silver badges45 bronze badges




        5,1172 gold badges12 silver badges45 bronze badges






























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f284414%2fmagento-2-2-8-sitemap-xml-contains-pub-dir-in-the-url-it-should-be-without%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

            Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

            Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form