7

Drupal by default does not allow trailing slash for pages and articles. Is it possible to allow trailing slash using a plugin?

3
  • why would you need it? trailing slash is not used for pages and articles; trailing slash, AFAIK, denotes a directory. Commented Nov 3, 2010 at 9:40
  • When you are moving an exisitng well optimized site to Drupal, you don't want to set a redirect for all the current url's ending with a trailing slash. Commented Nov 3, 2010 at 9:43
  • I see that several users migrating to Drupal face this problem. It is a pity that Drupal does not provide this feature by default :( Commented Nov 5, 2010 at 4:59

4 Answers 4

4

You could hack the globalredirect module to reverse its logic -- add the trailing slash if its not there, leave it alone if it is.

Sign up to request clarification or add additional context in comments.

2 Comments

The links added by Drupal do not have the trailing slash by default. Hence that will create an extra redirection for each pages having a trailing slash.
You'd have to hack the core url() function in common.inc.. I think thats realistically the only way you're going to accomplish getting the output to have the trailing slash.
1

As suggested by Nikit this should be doable through webserver rewrites.

There are some discussions on it on drupal.org. I would recommend heading over to freenode and asking on #drupal.

3 Comments

I am more interested in a solution that does not require hacking Drupal Core.
This would not involve hacking core. This involves mod_rewrite with Apache.
@markdorison, the second suggestion does discusses the hacks to the core (among other things). sorry for the confusion, i was a bit vague.
1

Trailing Slash module for Drupal 7:

http://drupal.org/project/trailing_slash

Might have a D6 version later.

1 Comment

I ended up not using Drupal, since it was an existing website. I will surely test it again. Thanks.
0

Try this: URL with trailing slash

1 Comment

I want a solution for Drupal. .htaccess modification alone won't be sufficient.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.