url rewriting - How to redirect URL to a subdomain except one folder that needs to go somewhere else

admin2025-01-08  5

I'm trying to workout how to generate the correct code for my .htaccess

I found the following code

RewriteEngine On RewriteCond %{HTTP_HOST} !^subdir\.maindomain\.co.uk$
[NC] RewriteRule ^(.*)$ https://shop\.maindomain\.co.uk/$1 [R=301,L]

This works great to forward all requests to the folders on the subdomain, but I need the folder

www.maindomain.co.uk/oldshop

to be forwarded to shop.maindomain.co.uk NOT to shop.maindomain.co.uk/oldshop as it currently is using the above code.

I can't work out how to add this part - hope this makes sense, thanks for your help!

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736270361a1422.html

最新回复(0)