1

I need to add a redirect that makes all traffic going to the first URL path below to the second URL path. This needs to be done in a bulk fashion for all pages listed under this path.

www.site.com/PATH/page
to
www.site.com/page

I've installed the module Match Redirect and began experimenting but I can't get it to work the way I need.

2

The "Match Redirect" module will redirect all matching patterns to only one target path. Here's relevant paragraph from the project page:

Only the source patterns can have wildcards. The target url is a single page and I have no plans to add wildcards to the target url.

To answer your question, you can do this is via .htaccess. Here's an example:

RewriteRule ^OLD-PATH/(.*)$ /NEW-PATH/$1 [R=301,NC,L]

I think it will work if you add these rules at the top of the .htaccess file, so they are executed before Drupal's rules.

  • You're welcome - glad it helped :) – Aram Boyajyan Mar 29 '16 at 15:01
0

One other way, without using additional modules would be to create a content with the alias oldurl adding the following full html content to the body:

<script>
window.location="http://www.yoursite.com/newurl"
</script>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.