I'm trying to redirect all the subfolders that come under /timetables and only the subfolders because the new website also has the main folder /timetables.
What i need is when a user types in /timetables/timetable1 they are redirected to /timetables
RedirectMatch 301 ^/timetables /timetables
<-- This sort of redirect has worked for me well when the new path is different to the old but when it is the same i get a redirect loop on the page.
Is there any way of selecting just the subfolders of a directory and redirecting them?
Many thanks
What i need is when a user types in /timetables/timetable1 they are redirected to /timetables
You can use:
RedirectMatch 301 ^/(timetables)/.+ /$1/
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.