How to build sitemap.xml for AngularJS website?












8















I have setup an AngularJS application which is using ui-state router. It has some static pages and other than that it has profile pages which generate dynamic page based on profile id.



For SEO purpose I have used PhantomJS and generate HTMLs to give crawler response.



But, How can I generate sitemap.xml which contains all the dynamic pages URL and by that crawler can fetch and list on search engine?










share|improve this question



























    8















    I have setup an AngularJS application which is using ui-state router. It has some static pages and other than that it has profile pages which generate dynamic page based on profile id.



    For SEO purpose I have used PhantomJS and generate HTMLs to give crawler response.



    But, How can I generate sitemap.xml which contains all the dynamic pages URL and by that crawler can fetch and list on search engine?










    share|improve this question

























      8












      8








      8








      I have setup an AngularJS application which is using ui-state router. It has some static pages and other than that it has profile pages which generate dynamic page based on profile id.



      For SEO purpose I have used PhantomJS and generate HTMLs to give crawler response.



      But, How can I generate sitemap.xml which contains all the dynamic pages URL and by that crawler can fetch and list on search engine?










      share|improve this question














      I have setup an AngularJS application which is using ui-state router. It has some static pages and other than that it has profile pages which generate dynamic page based on profile id.



      For SEO purpose I have used PhantomJS and generate HTMLs to give crawler response.



      But, How can I generate sitemap.xml which contains all the dynamic pages URL and by that crawler can fetch and list on search engine?







      angularjs xml seo phantomjs sitemap.xml






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 14 '16 at 14:42









      Mayur ChampaneriaMayur Champaneria

      124113




      124113
























          2 Answers
          2






          active

          oldest

          votes


















          0














          Using JavaScript



          You can use XMLWriter to create an XML. Then you can pass this XML as a string to your web server. Check this out for XML Writer.



          Here is a tutorial for the available methods for writing an XML using XMLWriter - Tutorial



          Using Nodejs



          You can write a node js function for generating the sitemap from the generated URLs. Please refer to this link for a sample.



          The better way is to create a script in the backend to generate it periodically to update sitemaps. Query the tables, create URLs and generate XML files. You can configure cron jobs in the server to generate the sitemaps periodically.



          There will be libraries and tutorials available for each BE technology for generating the sitemap.



          For example:



          Ruby on Rails - Nokogiri
          Elixir - sitemap
          .Net - Tutorial
          Java - Tutorial
          Express JS - express-sitemap






          share|improve this answer































            0














            Simple, You need to generate online Sitemap that creates all dynamic URLs.
            Just Search Online Sitemap Generator. put your Website URL and it creates the Sitemap.XML file, You need to download that file and upload in your server.



            after that check that Sitemap using www.mydomain.com/sitemap.xml






            share|improve this answer























              Your Answer






              StackExchange.ifUsing("editor", function () {
              StackExchange.using("externalEditor", function () {
              StackExchange.using("snippets", function () {
              StackExchange.snippets.init();
              });
              });
              }, "code-snippets");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "1"
              };
              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: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              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%2fstackoverflow.com%2fquestions%2f40591362%2fhow-to-build-sitemap-xml-for-angularjs-website%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              0














              Using JavaScript



              You can use XMLWriter to create an XML. Then you can pass this XML as a string to your web server. Check this out for XML Writer.



              Here is a tutorial for the available methods for writing an XML using XMLWriter - Tutorial



              Using Nodejs



              You can write a node js function for generating the sitemap from the generated URLs. Please refer to this link for a sample.



              The better way is to create a script in the backend to generate it periodically to update sitemaps. Query the tables, create URLs and generate XML files. You can configure cron jobs in the server to generate the sitemaps periodically.



              There will be libraries and tutorials available for each BE technology for generating the sitemap.



              For example:



              Ruby on Rails - Nokogiri
              Elixir - sitemap
              .Net - Tutorial
              Java - Tutorial
              Express JS - express-sitemap






              share|improve this answer




























                0














                Using JavaScript



                You can use XMLWriter to create an XML. Then you can pass this XML as a string to your web server. Check this out for XML Writer.



                Here is a tutorial for the available methods for writing an XML using XMLWriter - Tutorial



                Using Nodejs



                You can write a node js function for generating the sitemap from the generated URLs. Please refer to this link for a sample.



                The better way is to create a script in the backend to generate it periodically to update sitemaps. Query the tables, create URLs and generate XML files. You can configure cron jobs in the server to generate the sitemaps periodically.



                There will be libraries and tutorials available for each BE technology for generating the sitemap.



                For example:



                Ruby on Rails - Nokogiri
                Elixir - sitemap
                .Net - Tutorial
                Java - Tutorial
                Express JS - express-sitemap






                share|improve this answer


























                  0












                  0








                  0







                  Using JavaScript



                  You can use XMLWriter to create an XML. Then you can pass this XML as a string to your web server. Check this out for XML Writer.



                  Here is a tutorial for the available methods for writing an XML using XMLWriter - Tutorial



                  Using Nodejs



                  You can write a node js function for generating the sitemap from the generated URLs. Please refer to this link for a sample.



                  The better way is to create a script in the backend to generate it periodically to update sitemaps. Query the tables, create URLs and generate XML files. You can configure cron jobs in the server to generate the sitemaps periodically.



                  There will be libraries and tutorials available for each BE technology for generating the sitemap.



                  For example:



                  Ruby on Rails - Nokogiri
                  Elixir - sitemap
                  .Net - Tutorial
                  Java - Tutorial
                  Express JS - express-sitemap






                  share|improve this answer













                  Using JavaScript



                  You can use XMLWriter to create an XML. Then you can pass this XML as a string to your web server. Check this out for XML Writer.



                  Here is a tutorial for the available methods for writing an XML using XMLWriter - Tutorial



                  Using Nodejs



                  You can write a node js function for generating the sitemap from the generated URLs. Please refer to this link for a sample.



                  The better way is to create a script in the backend to generate it periodically to update sitemaps. Query the tables, create URLs and generate XML files. You can configure cron jobs in the server to generate the sitemaps periodically.



                  There will be libraries and tutorials available for each BE technology for generating the sitemap.



                  For example:



                  Ruby on Rails - Nokogiri
                  Elixir - sitemap
                  .Net - Tutorial
                  Java - Tutorial
                  Express JS - express-sitemap







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 27 '18 at 6:12









                  Tessy ThomasTessy Thomas

                  1,112716




                  1,112716

























                      0














                      Simple, You need to generate online Sitemap that creates all dynamic URLs.
                      Just Search Online Sitemap Generator. put your Website URL and it creates the Sitemap.XML file, You need to download that file and upload in your server.



                      after that check that Sitemap using www.mydomain.com/sitemap.xml






                      share|improve this answer




























                        0














                        Simple, You need to generate online Sitemap that creates all dynamic URLs.
                        Just Search Online Sitemap Generator. put your Website URL and it creates the Sitemap.XML file, You need to download that file and upload in your server.



                        after that check that Sitemap using www.mydomain.com/sitemap.xml






                        share|improve this answer


























                          0












                          0








                          0







                          Simple, You need to generate online Sitemap that creates all dynamic URLs.
                          Just Search Online Sitemap Generator. put your Website URL and it creates the Sitemap.XML file, You need to download that file and upload in your server.



                          after that check that Sitemap using www.mydomain.com/sitemap.xml






                          share|improve this answer













                          Simple, You need to generate online Sitemap that creates all dynamic URLs.
                          Just Search Online Sitemap Generator. put your Website URL and it creates the Sitemap.XML file, You need to download that file and upload in your server.



                          after that check that Sitemap using www.mydomain.com/sitemap.xml







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Nov 27 '18 at 9:52









                          Bhagirath SindhavBhagirath Sindhav

                          12




                          12






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Stack Overflow!


                              • 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%2fstackoverflow.com%2fquestions%2f40591362%2fhow-to-build-sitemap-xml-for-angularjs-website%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







                              這個網誌中的熱門文章

                              Xamarin.form Move up view when keyboard appear

                              Post-Redirect-Get with Spring WebFlux and Thymeleaf

                              Anylogic : not able to use stopDelay()