REMINDER - Stay logged in for at least 2 hours a week to get whitelisted.
Also it helps build a picture where our "good traffic" is coming from for detection scripts.
:o)

Apache2 redirect only specific folders ?

This chat forum will appear to guests and bots. IE will appear on search engines etc. If you do not want your appearing publicly then please use the original chat forum.
User avatar
exxos
Site Admin
Site Admin
Posts: 28447
Joined: 16 Aug 2017 23:19
Location: UK

Apache2 redirect only specific folders ?

Post by exxos »

Does anyone know how to set up inclusions or exclusions in a permanent redirect ?

Currently I am redirecting ALL exxoshost URLs to exxosforum. However this is causing a problem with the site certificates because the exxoshost URL redirects to a exxosforum URL where the URL now incorrect :roll:

EG:

Code: Select all

getssl: for some reason could not reach http://exxosforum.co.uk/.well-known/acme-challenge/pmYWsIba5dGZ
The actual URL is valid bought Apaches redirecting it to exxoforum which is a different folder on the server.

Code: Select all

<IfModule mod_ssl.c>
	<VirtualHost *:443>
ServerName exxoshost.co.uk
ServerAlias www.exxoshost.co.uk
		DocumentRoot /var/www/html/
		SSLEngine on
Redirect permanent / https://exxosforum.co.uk/
	</VirtualHost>
</IfModule>

So is there any way to exclude the ".well-known/" Path from the redirect ?

Or alternatively only redirect folders such as exxosforum.co.uk/atari/ and exxosforum.co.uk/forum/ ? Could possibly be better I guess :shrug:
xyzzy76
Posts: 25
Joined: 22 Dec 2018 16:43

Re: Apache2 redirect only specific folders ?

Post by xyzzy76 »

Is this any good?

Code: Select all

RedirectMatch 301 ^\/((?!\.well\-known\/).*)$ [THEIR_REDIRECT_TO_URL]
https://servebolt.com/help/article/how- ... direction/
A1200 rev 1B & 1230-IV 50MHz / CPC 6128 / CPC 464 / ZX Spectrum 48K / ZX81
User avatar
exxos
Site Admin
Site Admin
Posts: 28447
Joined: 16 Aug 2017 23:19
Location: UK

Re: Apache2 redirect only specific folders ?

Post by exxos »

Oh cool. Thanks, never thought to look for my specific problem. I tend to just assume it's just me in the entire world who has such problems :lol: :roll:
User avatar
exxos
Site Admin
Site Admin
Posts: 28447
Joined: 16 Aug 2017 23:19
Location: UK

Re: Apache2 redirect only specific folders ?

Post by exxos »

That does seem to solve the problem but somehow created a new problem :(

EG www.exxosforum.co.uk/atari/last/ now redirects to the forum :shrug:
User avatar
exxos
Site Admin
Site Admin
Posts: 28447
Joined: 16 Aug 2017 23:19
Location: UK

Re: Apache2 redirect only specific folders ?

Post by exxos »

hmm odd.

REDIRECT OK

http://exxosforum.co.uk/atari/last/
https://exxosforum.co.uk/atari/last/

NOT OK

http://www.exxosforum.co.uk/atari/last/
https://www.exxosforum.co.uk/atari/last/

So for some reason www is not redirecting to where it is supposed to be going :shrug:

Also, why do these regex testers never do anything ?!

Capture.JPG
You do not have the required permissions to view the files attached to this post.
User avatar
exxos
Site Admin
Site Admin
Posts: 28447
Joined: 16 Aug 2017 23:19
Location: UK

Re: Apache2 redirect only specific folders ?

Post by exxos »

Bizarrely the redirect seems to work fine in Opera & FF but not in Chrome :pullhair: .

EDIT:

OK cleared the cache in chrome and now works.. Really getting fedup with chrome lately :roll:

Return to “CHAT FORUM PUBLIC”

Who is online

Users browsing this forum: ClaudeBot and 1 guest