how to redirect to the default page if a wrong URL is typed

Alles, was den Apache betrifft, kann hier besprochen werden.

how to redirect to the default page if a wrong URL is typed

Postby cocorocho » 10. February 2022 13:34

hi,
I have a web page lets called https://www.mypage.com and it has to main virtual hosts that communicate with a WebSphere AS.
The paths are https://www.mypage.com/MP-PRIV and https://www.mypage.com/MP-PUB.
What I need to do due to security concerns is that anyone types https://www.mypage.com/anything-wrong the pages redirects to https://www.mypage.com
Please help!!!
Thanks
Cocorocho (lost in apache)
cocorocho
 
Posts: 1
Joined: 10. February 2022 13:29
XAMPP version: 2.1
Operating System: windows

Re: how to redirect to the default page if a wrong URL is ty

Postby Altrea » 10. February 2022 14:12

Hi,

you want to do a Rewrite with exclusions, like here:
https://stackoverflow.com/a/3414038
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11933
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: how to redirect to the default page if a wrong URL is ty

Postby Nobbie » 10. February 2022 17:25

cocorocho wrote:What I need to do due to security concerns is that anyone types https://www.mypage.com/anything-wrong the pages redirects to https://www.mypage.com


Nothing. Apache does not redirect to www.mypage.com in case of an unknown URL. If it does so on your PC, your the one that did configure the redirect. So dont redirect.
Nobbie
 
Posts: 13176
Joined: 09. March 2008 13:04

Re: how to redirect to the default page if a wrong URL is ty

Postby jhonalbert » 08. March 2022 12:41

How can I redirect to 'Notfound' page when wrong url is entered.
I have following Routes:
<Switch>
<Route path="/about" component={About} />
<Route path="/contact" component={Contact} />
<Route path="/dashboard" component={Dashboard} />
<Route path="/" component={Home} />
<Route path="**" component={Notfound} />
</Switch>
jhonalbert
 
Posts: 1
Joined: 31. December 2021 11:03
XAMPP version: 7.3
Operating System: windows


Return to Apache

Who is online

Users browsing this forum: No registered users and 170 guests