i have a folder i want to redirect to another folder
i could do this simply with :
Redirectpermanent /old-folder/ https://www.example.com/new-folder/
BUT i need to keep the homepage of this folder as it is
so /old-folder/ should stay as it is, only the internal pages of this folder should be redirected
i tried codes like this :
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
#if not root
RewriteCond %{REQUEST_URI} !^/old-folder/?$ [NC]
#redirect
RewriteRule ^old-folder/(.*)$ http://www.example.com/new-folder/$1 [R=301,L]
but i am getting 404 with this
Any idea ?
Thank you
question from:
https://stackoverflow.com/questions/65919235/redirect-301-of-folder-except-homepage 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…