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;
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
add a comment |
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
add a comment |
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
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
.htaccess url http-redirect
asked Mar 26 at 14:23
MichaelMichael
63 bronze badges
63 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
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
add a comment |
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
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
add a comment |
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
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
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
add a comment |
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
add a comment |
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.
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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