1

The Global Redirect module has a "deslash" feature. It forces all URLs to not have a trailing slash at the end. If you add a slash at the end of a URL it will redirect you to the correct page.

I'm looking for the opposite of this and would like to have a trailing slash on every URL.

I tried the Trailing Slash module for Drupal 7 but just got a lot of errors. Are there any other methods?

Any help would be greatly appreciated!

Thank you.

2 Answers 2

1

Rather than using a module, you can accomplish this via httpd's mod_rewrite as detailed here, here and elsewhere. The appropriate rules can be incorporated into the .htaccess file in Drupal's root. Once you are done, make sure that you check all the various components of the site - CSS & JS files, images, directories, clean URLs on/off, path aliases on/off and so on.

1
  • I would advise against this. The reason being Drupal's internals will publish aliases without a trailing slash. This means that for each URL created by Drupal, you will be 301 redirecting to the slashed version. There is a module to handle this at the core level: drupal.org/project/trailing_slash
    – Du3
    Jan 18, 2013 at 18:08
0

I would look at the code that applies these functions in both of the modules you mentioned. You should be able to determine what elements of the code would be helpful in recreating them but to do the vice versa...

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.