Search

Hi,

I've redesigned a website with symphony, I've run into a problem with google search results and other websites linking to non existing locations. For example, www.mypage.com/contact.html/

Is it somehow possible to add a line to .htacces that automatically redirects pages that end with .html/ to the home page?

Thanks!

Not tested, but something like this should work:

RewriteRule ^(.*).html$ / [R=301,L]

To include the trailing slash, shouldn't that be:

RewriteRule ^(.*).html/$ / [R=301,L]

To include the trailing slash, shouldn't that be:

You don't have a trailing slash after files (like .html).

The slash in my example is actually the target (root).

^(.*).html$rewrites to /

I think in this case having the trailing slash after the filename in external links to the site is Vandenberg's problem.

Thanks, very educational. I ended up having to use both.

Much obliged.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details