1

I have old links, for example the following ones.

  • index.php/event/nr1
  • index.php/event/nr2

If users are coming on index.php/event/*, they should be redirected to /event.

How can I achieve this?

closed as too broad by kiamlaluno Jun 6 at 9:18

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

4

You can use Match Redirect module.
How to use:
1) Enable module as usual
2) Go to configuration page /admin/config/search/match_redirect
3) Add redirect settings there
enter image description here

0

Check if(!empty(arg(1))) { drupal_goto('events')}

You can write this in any of your custom module using hook modulename_init() function.

In your case the argument number may change, please do check and change the argument number.

0

There are Rewrite Rules that can be used to achieve the same thing on drupal 7 as well as on drupal 8. Use this Rewrite Rule in .htaccess file located in Drupal Root directory.

RewriteEngine on
RewriteCond %{REQUEST_URI} index.php/event/
RewriteRule ^(.*) http://www.domain.com/event [L,R=301]

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