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

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

            Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

            Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?