Skip to content Skip to navigation

Redirect from AFS to and exclude one directory

Posted by: 

We have recently moved a website from /afs/ir/group/name-of-group/ to platform with url and we wanted to redirect everything from old site to new site, except forms that are built using Form Builder.

I wanted to share our .htaccess code for those who are following the same trail...

RewriteEngine On
RewriteCond %{REQUEST_URI} !/group/name-of-group/forms [NC]
RewriteCond %{HTTP_HOST} !$ [NC]
RewriteRule ^(.*)$$1 [L,R=301]

An alternative method is to exclude only Formbuilder forms:

# ignore Web Forms Service URLs
RewriteCond %{REQUEST_URI} !.*\.(fb|FB|Fb)$