Redirect existing second page to non-existing urlWhat is the difference between a URI, a URL and a URN?Encode URL in JavaScript?Path.Combine for URLs?Get current URL with jQuery?What is the maximum length of a URL in different browsers?How do I modify the URL without reloading the page?Get the current URL with JavaScript?Redirecting to a relative URL in JavaScriptHow to change the URI (URL) for a remote Git repository?Get the full URL in PHP

Why did modems have speakers?

Are gangsters hired to attack people at a train station classified as a terrorist attack?

Host telling me to cancel my booking in exchange for a discount?

Why do people say "I am broke" instead of "I am broken"?

Is it ethical to tell my teaching assistant that I like him?

Killing a star safely

What is a "staved" town, like in "Staverton"?

Short story where a flexible reality hardens to an unchanging one

Why did computer video outputs go from digital to analog, then back to digital?

How did pilots avoid thunderstorms and related weather before “reliable” airborne weather radar was introduced on airliners?

Why are Oscar, India, and X-Ray (O, I, and X) not used as taxiway identifiers?

How to run a substitute command on only a certain part of the line

Can a creature sustain itself by eating its own severed body parts?

Can I pay with HKD in Macau or Shenzhen?

Does switching on an old games console without a cartridge damage it?

Strange LED behavior: Why is there a voltage over the LED with only one wire connected to it?

Does starting a profile in Mon Projet mean I applied to enter or remain in Canada?

Can you find Airpod Case using Find my iPhone?

Can I make an Opportunity Attack during Time Stop?

How can I print a 1 cm overhang with minimal supports?

Arduino Bluetooth communication is slowing down because of the 'for' loop!

Why does the salt in the oceans not sink to the bottom?

Xcode 10.3 Installation

Why can't a country print its own money to spend it only abroad?



Redirect existing second page to non-existing url


What is the difference between a URI, a URL and a URN?Encode URL in JavaScript?Path.Combine for URLs?Get current URL with jQuery?What is the maximum length of a URL in different browsers?How do I modify the URL without reloading the page?Get the current URL with JavaScript?Redirecting to a relative URL in JavaScriptHow to change the URI (URL) for a remote Git repository?Get the full URL in PHP






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








0















I have a site https://sitename.com/web (example). So, full path to page is sitename.com/web/index.php. On ftp server there is folder /web which also contain second page file - index-2.php. How to avoid creating /web-2/ folder and redirect index-2.php to sitename.com/web-2 ?










share|improve this question




























    0















    I have a site https://sitename.com/web (example). So, full path to page is sitename.com/web/index.php. On ftp server there is folder /web which also contain second page file - index-2.php. How to avoid creating /web-2/ folder and redirect index-2.php to sitename.com/web-2 ?










    share|improve this question
























      0












      0








      0








      I have a site https://sitename.com/web (example). So, full path to page is sitename.com/web/index.php. On ftp server there is folder /web which also contain second page file - index-2.php. How to avoid creating /web-2/ folder and redirect index-2.php to sitename.com/web-2 ?










      share|improve this question














      I have a site https://sitename.com/web (example). So, full path to page is sitename.com/web/index.php. On ftp server there is folder /web which also contain second page file - index-2.php. How to avoid creating /web-2/ folder and redirect index-2.php to sitename.com/web-2 ?







      .htaccess url http-redirect






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 26 at 14:23









      MichaelMichael

      63 bronze badges




      63 bronze badges






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Easy, create an .htaccess file inside the root folder of your site, then add the following lines to it:



          RewriteEngine On

          RewriteRule ^web-2$ index-2.php [QSA,L,NC]


          This site might help you with htaccess:



          https://www.htaccessredirect.net/



          A nice tutorial on .htaccess files also below:



          https://www.digitalocean.com/community/tutorials/how-to-use-the-htaccess-file






          share|improve this answer

























          • Doesn't work. I want my link sitename.com/web/index-2.php (existing file and path) to be shown as sitename.com/web-2 (non existing path)

            – Michael
            Mar 26 at 17:38












          • have you tried creating an .htaccess file in the root of your domain and adding that?

            – MonneratRJ
            Mar 26 at 17:50











          • Of course, nothing changed

            – Michael
            Mar 26 at 20:26











          • digitalocean.com/community/tutorials/… well maybe it's missing something... take a look at this tutorial about htaccess, im sure you'll find your answer there... htaccess is the key to achieve what you want.

            – MonneratRJ
            Mar 26 at 20:44










          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%2f55359478%2fredirect-existing-second-page-to-non-existing-url%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














          Easy, create an .htaccess file inside the root folder of your site, then add the following lines to it:



          RewriteEngine On

          RewriteRule ^web-2$ index-2.php [QSA,L,NC]


          This site might help you with htaccess:



          https://www.htaccessredirect.net/



          A nice tutorial on .htaccess files also below:



          https://www.digitalocean.com/community/tutorials/how-to-use-the-htaccess-file






          share|improve this answer

























          • Doesn't work. I want my link sitename.com/web/index-2.php (existing file and path) to be shown as sitename.com/web-2 (non existing path)

            – Michael
            Mar 26 at 17:38












          • have you tried creating an .htaccess file in the root of your domain and adding that?

            – MonneratRJ
            Mar 26 at 17:50











          • Of course, nothing changed

            – Michael
            Mar 26 at 20:26











          • digitalocean.com/community/tutorials/… well maybe it's missing something... take a look at this tutorial about htaccess, im sure you'll find your answer there... htaccess is the key to achieve what you want.

            – MonneratRJ
            Mar 26 at 20:44















          0














          Easy, create an .htaccess file inside the root folder of your site, then add the following lines to it:



          RewriteEngine On

          RewriteRule ^web-2$ index-2.php [QSA,L,NC]


          This site might help you with htaccess:



          https://www.htaccessredirect.net/



          A nice tutorial on .htaccess files also below:



          https://www.digitalocean.com/community/tutorials/how-to-use-the-htaccess-file






          share|improve this answer

























          • Doesn't work. I want my link sitename.com/web/index-2.php (existing file and path) to be shown as sitename.com/web-2 (non existing path)

            – Michael
            Mar 26 at 17:38












          • have you tried creating an .htaccess file in the root of your domain and adding that?

            – MonneratRJ
            Mar 26 at 17:50











          • Of course, nothing changed

            – Michael
            Mar 26 at 20:26











          • digitalocean.com/community/tutorials/… well maybe it's missing something... take a look at this tutorial about htaccess, im sure you'll find your answer there... htaccess is the key to achieve what you want.

            – MonneratRJ
            Mar 26 at 20:44













          0












          0








          0







          Easy, create an .htaccess file inside the root folder of your site, then add the following lines to it:



          RewriteEngine On

          RewriteRule ^web-2$ index-2.php [QSA,L,NC]


          This site might help you with htaccess:



          https://www.htaccessredirect.net/



          A nice tutorial on .htaccess files also below:



          https://www.digitalocean.com/community/tutorials/how-to-use-the-htaccess-file






          share|improve this answer















          Easy, create an .htaccess file inside the root folder of your site, then add the following lines to it:



          RewriteEngine On

          RewriteRule ^web-2$ index-2.php [QSA,L,NC]


          This site might help you with htaccess:



          https://www.htaccessredirect.net/



          A nice tutorial on .htaccess files also below:



          https://www.digitalocean.com/community/tutorials/how-to-use-the-htaccess-file







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 26 at 20:44

























          answered Mar 26 at 15:12









          MonneratRJMonneratRJ

          1349 bronze badges




          1349 bronze badges












          • Doesn't work. I want my link sitename.com/web/index-2.php (existing file and path) to be shown as sitename.com/web-2 (non existing path)

            – Michael
            Mar 26 at 17:38












          • have you tried creating an .htaccess file in the root of your domain and adding that?

            – MonneratRJ
            Mar 26 at 17:50











          • Of course, nothing changed

            – Michael
            Mar 26 at 20:26











          • digitalocean.com/community/tutorials/… well maybe it's missing something... take a look at this tutorial about htaccess, im sure you'll find your answer there... htaccess is the key to achieve what you want.

            – MonneratRJ
            Mar 26 at 20:44

















          • Doesn't work. I want my link sitename.com/web/index-2.php (existing file and path) to be shown as sitename.com/web-2 (non existing path)

            – Michael
            Mar 26 at 17:38












          • have you tried creating an .htaccess file in the root of your domain and adding that?

            – MonneratRJ
            Mar 26 at 17:50











          • Of course, nothing changed

            – Michael
            Mar 26 at 20:26











          • digitalocean.com/community/tutorials/… well maybe it's missing something... take a look at this tutorial about htaccess, im sure you'll find your answer there... htaccess is the key to achieve what you want.

            – MonneratRJ
            Mar 26 at 20:44
















          Doesn't work. I want my link sitename.com/web/index-2.php (existing file and path) to be shown as sitename.com/web-2 (non existing path)

          – Michael
          Mar 26 at 17:38






          Doesn't work. I want my link sitename.com/web/index-2.php (existing file and path) to be shown as sitename.com/web-2 (non existing path)

          – Michael
          Mar 26 at 17:38














          have you tried creating an .htaccess file in the root of your domain and adding that?

          – MonneratRJ
          Mar 26 at 17:50





          have you tried creating an .htaccess file in the root of your domain and adding that?

          – MonneratRJ
          Mar 26 at 17:50













          Of course, nothing changed

          – Michael
          Mar 26 at 20:26





          Of course, nothing changed

          – Michael
          Mar 26 at 20:26













          digitalocean.com/community/tutorials/… well maybe it's missing something... take a look at this tutorial about htaccess, im sure you'll find your answer there... htaccess is the key to achieve what you want.

          – MonneratRJ
          Mar 26 at 20:44





          digitalocean.com/community/tutorials/… well maybe it's missing something... take a look at this tutorial about htaccess, im sure you'll find your answer there... htaccess is the key to achieve what you want.

          – MonneratRJ
          Mar 26 at 20:44








          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















          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%2f55359478%2fredirect-existing-second-page-to-non-existing-url%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

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현