Magento 2: Get root path in url, when the domain name doesn't match with magento folder nameHad to restore site, when it came back it has index.php in the urls, how do I get rid of the index.phpHow to restrict user to access website by index.phpHow to get Magento root url properly?How to get site url inside javascript file?Magento 2 Multistore is not working with multi domainGenerate Adminhtml Controller url with get parameter in BlockRun magento extension model inside php scriptMagento 2 : How to get Custom Field Image Icon url from admin catalog category page?Headless Magento 2: Need custom URL instead of domain/products/:SKUCustom script leading to 404 in M2

Can sampling rate be a floating point number?

Why is the result of ('b'+'a'+ + 'a' + 'a').toLowerCase() 'banana'?

80's/90's superhero cartoon with a man on fire and a man who made ice runways like Frozone

How to remove ambiguity: "... lives in the city of H, the capital of the province of NS, WHERE the unemployment rate is ..."?

On math looking obvious in retrospect

Is it okay for a ticket seller in the USA to refuse to give you your change, keep it for themselves and claim it's a tip?

What is this "Table of astronomy" about?

Why does the standard fingering / strumming for a D maj chord leave out the 5th string?

Simplification of numbers

0xF1 opcode-prefix on i80286

Why I have higher ping to the VLAN interface than to other local interfaces

AsyncDictionary - Can you break thread safety?

Heat equation: Squiggly lines

Bitcoin successfully deducted on sender wallet but did not reach receiver wallet

How can God warn people of the upcoming rapture without disrupting society?

is this F 6'9 chord a figured bass or a chord extension?

A continuous water "planet" ring around a star

How to divide item stack in MC PE?

Lengthened voiced stops and the airstream through the nose

Mapping an Aitoff projection onto a sphere

Why is there a large performance impact when looping over an array over 240 elements?

WhatsApp calls on an iPhone and "data" and "minutes"

What is a good class if we remove subclasses?

Annotating a table with arrows



Magento 2: Get root path in url, when the domain name doesn't match with magento folder name


Had to restore site, when it came back it has index.php in the urls, how do I get rid of the index.phpHow to restrict user to access website by index.phpHow to get Magento root url properly?How to get site url inside javascript file?Magento 2 Multistore is not working with multi domainGenerate Adminhtml Controller url with get parameter in BlockRun magento extension model inside php scriptMagento 2 : How to get Custom Field Image Icon url from admin catalog category page?Headless Magento 2: Need custom URL instead of domain/products/:SKUCustom script leading to 404 in M2






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








0















I have domain name for my magento 2 site something like https://abcxyz.com/index.php, and my project folder name is something like shop.xyz.com (folder name). Now I have added an external file test.php inside magento 2 folder. I want something like https://abcxyz.com/test.php.
How can I get like this in magento header phtml file ?? Thanks for the help in advance.










share|improve this question
































    0















    I have domain name for my magento 2 site something like https://abcxyz.com/index.php, and my project folder name is something like shop.xyz.com (folder name). Now I have added an external file test.php inside magento 2 folder. I want something like https://abcxyz.com/test.php.
    How can I get like this in magento header phtml file ?? Thanks for the help in advance.










    share|improve this question




























      0












      0








      0








      I have domain name for my magento 2 site something like https://abcxyz.com/index.php, and my project folder name is something like shop.xyz.com (folder name). Now I have added an external file test.php inside magento 2 folder. I want something like https://abcxyz.com/test.php.
      How can I get like this in magento header phtml file ?? Thanks for the help in advance.










      share|improve this question
















      I have domain name for my magento 2 site something like https://abcxyz.com/index.php, and my project folder name is something like shop.xyz.com (folder name). Now I have added an external file test.php inside magento 2 folder. I want something like https://abcxyz.com/test.php.
      How can I get like this in magento header phtml file ?? Thanks for the help in advance.







      magento2 php url






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 1 at 10:15









      Mohit Rane

      1,20718 bronze badges




      1,20718 bronze badges










      asked Aug 1 at 9:17









      Dharma TejaDharma Teja

      1




      1























          1 Answer
          1






          active

          oldest

          votes


















          0















          1. Use Web Server Rewrites: YES



          Go to System >> Configuration >> Web >> Search Engines Optimization



          1. Use secure URL Frontend: YES



          Go to System >> Configuration >>Web >>Secure


          Flush the cache and check your domain is working without index.php



          Note. Check if .htaccess is working or not



          Hope this solution will work for you






          share|improve this answer



























          • Thanks, but I want to call test.php file in phtml file, can you please help me out ?

            – Dharma Teja
            Aug 1 at 9:54











          • If your magento instance run without index.php then you can access test.php like this - yourdomain.com/test.php

            – Mitro
            Aug 1 at 10:03











          • is there a way that without removing index.php can we add test.php ??

            – Dharma Teja
            Aug 1 at 10:06












          • You can create index.php instead test.php and put it in some folder name for eg.test and you can access it by domain.com/test in which test is your folder name

            – Mitro
            Aug 1 at 10:11











          • So if I remove index.php will domain.com/test.php work ?

            – Dharma Teja
            Aug 1 at 10:17













          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%2f284064%2fmagento-2-get-root-path-in-url-when-the-domain-name-doesnt-match-with-magento%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









          0















          1. Use Web Server Rewrites: YES



          Go to System >> Configuration >> Web >> Search Engines Optimization



          1. Use secure URL Frontend: YES



          Go to System >> Configuration >>Web >>Secure


          Flush the cache and check your domain is working without index.php



          Note. Check if .htaccess is working or not



          Hope this solution will work for you






          share|improve this answer



























          • Thanks, but I want to call test.php file in phtml file, can you please help me out ?

            – Dharma Teja
            Aug 1 at 9:54











          • If your magento instance run without index.php then you can access test.php like this - yourdomain.com/test.php

            – Mitro
            Aug 1 at 10:03











          • is there a way that without removing index.php can we add test.php ??

            – Dharma Teja
            Aug 1 at 10:06












          • You can create index.php instead test.php and put it in some folder name for eg.test and you can access it by domain.com/test in which test is your folder name

            – Mitro
            Aug 1 at 10:11











          • So if I remove index.php will domain.com/test.php work ?

            – Dharma Teja
            Aug 1 at 10:17















          0















          1. Use Web Server Rewrites: YES



          Go to System >> Configuration >> Web >> Search Engines Optimization



          1. Use secure URL Frontend: YES



          Go to System >> Configuration >>Web >>Secure


          Flush the cache and check your domain is working without index.php



          Note. Check if .htaccess is working or not



          Hope this solution will work for you






          share|improve this answer



























          • Thanks, but I want to call test.php file in phtml file, can you please help me out ?

            – Dharma Teja
            Aug 1 at 9:54











          • If your magento instance run without index.php then you can access test.php like this - yourdomain.com/test.php

            – Mitro
            Aug 1 at 10:03











          • is there a way that without removing index.php can we add test.php ??

            – Dharma Teja
            Aug 1 at 10:06












          • You can create index.php instead test.php and put it in some folder name for eg.test and you can access it by domain.com/test in which test is your folder name

            – Mitro
            Aug 1 at 10:11











          • So if I remove index.php will domain.com/test.php work ?

            – Dharma Teja
            Aug 1 at 10:17













          0












          0








          0








          1. Use Web Server Rewrites: YES



          Go to System >> Configuration >> Web >> Search Engines Optimization



          1. Use secure URL Frontend: YES



          Go to System >> Configuration >>Web >>Secure


          Flush the cache and check your domain is working without index.php



          Note. Check if .htaccess is working or not



          Hope this solution will work for you






          share|improve this answer
















          1. Use Web Server Rewrites: YES



          Go to System >> Configuration >> Web >> Search Engines Optimization



          1. Use secure URL Frontend: YES



          Go to System >> Configuration >>Web >>Secure


          Flush the cache and check your domain is working without index.php



          Note. Check if .htaccess is working or not



          Hope this solution will work for you







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Aug 1 at 11:19









          Raj Mohan R

          1,7973 silver badges13 bronze badges




          1,7973 silver badges13 bronze badges










          answered Aug 1 at 9:30









          MitroMitro

          3167 bronze badges




          3167 bronze badges















          • Thanks, but I want to call test.php file in phtml file, can you please help me out ?

            – Dharma Teja
            Aug 1 at 9:54











          • If your magento instance run without index.php then you can access test.php like this - yourdomain.com/test.php

            – Mitro
            Aug 1 at 10:03











          • is there a way that without removing index.php can we add test.php ??

            – Dharma Teja
            Aug 1 at 10:06












          • You can create index.php instead test.php and put it in some folder name for eg.test and you can access it by domain.com/test in which test is your folder name

            – Mitro
            Aug 1 at 10:11











          • So if I remove index.php will domain.com/test.php work ?

            – Dharma Teja
            Aug 1 at 10:17

















          • Thanks, but I want to call test.php file in phtml file, can you please help me out ?

            – Dharma Teja
            Aug 1 at 9:54











          • If your magento instance run without index.php then you can access test.php like this - yourdomain.com/test.php

            – Mitro
            Aug 1 at 10:03











          • is there a way that without removing index.php can we add test.php ??

            – Dharma Teja
            Aug 1 at 10:06












          • You can create index.php instead test.php and put it in some folder name for eg.test and you can access it by domain.com/test in which test is your folder name

            – Mitro
            Aug 1 at 10:11











          • So if I remove index.php will domain.com/test.php work ?

            – Dharma Teja
            Aug 1 at 10:17
















          Thanks, but I want to call test.php file in phtml file, can you please help me out ?

          – Dharma Teja
          Aug 1 at 9:54





          Thanks, but I want to call test.php file in phtml file, can you please help me out ?

          – Dharma Teja
          Aug 1 at 9:54













          If your magento instance run without index.php then you can access test.php like this - yourdomain.com/test.php

          – Mitro
          Aug 1 at 10:03





          If your magento instance run without index.php then you can access test.php like this - yourdomain.com/test.php

          – Mitro
          Aug 1 at 10:03













          is there a way that without removing index.php can we add test.php ??

          – Dharma Teja
          Aug 1 at 10:06






          is there a way that without removing index.php can we add test.php ??

          – Dharma Teja
          Aug 1 at 10:06














          You can create index.php instead test.php and put it in some folder name for eg.test and you can access it by domain.com/test in which test is your folder name

          – Mitro
          Aug 1 at 10:11





          You can create index.php instead test.php and put it in some folder name for eg.test and you can access it by domain.com/test in which test is your folder name

          – Mitro
          Aug 1 at 10:11













          So if I remove index.php will domain.com/test.php work ?

          – Dharma Teja
          Aug 1 at 10:17





          So if I remove index.php will domain.com/test.php work ?

          – Dharma Teja
          Aug 1 at 10:17

















          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%2f284064%2fmagento-2-get-root-path-in-url-when-the-domain-name-doesnt-match-with-magento%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

          Grendel Contents Story Scholarship Depictions Notes References Navigation menu10.1093/notesj/gjn112Berserkeree

          Area configuration aggregation error after install Porto themeMagento 2.1 CE Installed but front/backend not loading/workingCSS not loading on page within Magento 2 pageCannot install module in Magento 2no commands defined in the “setup” namespace. in Magento2Magento 2: Static files are present but shows 404Why do i have to always run the commands to clean cache in Magento 2.1.8?Failure reason: 'Unable to unserialize value.'Error 500 after magento migrationIn production mode the site does not loadMagento 2 : Error 500 after installing

          Middle Expansion Olielle Resaix Definition: Uttering songs of triumph shouting with joy triumphant exulting Sejunction Journal 붙다 달 고급 품목 외출 The stretch trades the screeching tin. Definition: The act of speaking with a drawl a drawl Cough Sand Definition: An uproar a quarrel a noisy outbreak Shake Iron Publicize Horse House Baby 사과 Resaix Flaggy Jelly Temporary Unequaled Puppet A drop in the bucket Shrew 성격 회원 성질 미팅 The burn frames the tacky quality. Materialistic The smoke reduces the way. Yammoe Nondescript Cheek 얼굴 배 약하다 날리다 타다 The illegal country shows the iron. Help Rule Drearien Smoke Teaching Meaty Wasp Abraham Lincoln Jaws 진심 수리하다 Size Cork Idea Convert Think Lark John Lennon 거울 청소 군 추천하다 아이스크림