1

Having a Drupal here. In that Drupal is a folder with another Drupal. So in another Drupal's .htacces the base was rewritten like this Rewrite Base /another-drupal and everything's fine.

Now, printed invitations were send to customers to look at the another Drupal via its URL adrupal.com/another-drupal. And like right now the URL stands at the end of a sentence and the dot looks like it is part of the URL. How do I redirect all users who entered the URL with a trailing dot to the correct URL without the trailing dot? And in which .htaccess do I have to do that? The parent's Drupal .htacess? Or in the another Drupal's .htaccess?

I allready tried that approach: Redirect url to home page with trailing dots, but it didn't work. Is it maybe because in that example they have two dots?

4

2 回答 2

3

尝试:

RewriteCond %{THE_REQUEST} \ /([^\?\ .]*)\.(?:\?|\ |$)
RewriteRule ^ /%1 [L,R=301]
于 2013-09-30T11:00:10.767 回答
1

看起来这个简单的规则就是你所需要的:

RewriteRule ^(.+?)\.$ $1 [L,R=301]

这将从任何 URL 中删除尾随句点(点)。

于 2013-09-30T11:09:56.103 回答