1

I'm having a bit of a strange problem on a couple of Joomla sites and I'm not really sure where to start with figuring out what the problem is.

When I crawl the site with Screaming frog, I am getting duplicate URL's in the following format:

mydomain.com/contact
mydomain.com//contact
mydomain.com///contact
mydomain.com////contact
mydomain.com/////contact

So on and so on...any idea's how I can prevent this and/or do you know what is causing it? The site I am currently looking at has Joomsef installed but there does not seem to be any configuration settings to tackle this and their support is pretty rubbish thus i am no longer using the extension on new builds.

Can this be tackled in the .htaccess?

Regards Donna

  • Do you also have the same issue when trying to crawl the site using Google? – Lodder Oct 16 '17 at 13:27
1

This is the way how the Joomla Router works, he ignores multiple slashes. If you want to prevent this than you have to add something to you htaccess file. To redirect such requests:

Add this in your htaccess before you see this line RewriteBase /:

RewriteCond %{REQUEST_URI} ^/?([^/]+)//+(.*)$
RewriteRule ^.*$ /%1/%2 [R=301,L]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,7}\s//+(.*)\sHTTP.*$
RewriteRule ^.*$ /%1 [R=301,L]

The first two lines will redirect if you have multiple slashes somewhere in your request, but not at the beginning. The second part is redirecting if you have multiple slashes at the beginning.

I tested this positive on Apache 2.4

1

Before answering your question, let me first comment on the answer by @Webdesigner. By default, any website in the world will work with multiple slashes. Many of these websites (especially the Apache powered websites) will automatically remove the multiple slashes because it seems to be against the standard.

Now, going back to the original question, it might be that there is an error in the structure of the menu, or it might be that JoomSEF (or another extension) is causing this mess. Joomla, by default, doesn't do that. First, try disabling JoomSEF (revert back to Joomla's own SEF) and see if that fixes the problem, if it doesn't, then try disabling non core plugins one by one. If the problem is still there, then try disabling menu items one by one.

Final note: The issue might be caused by a bug in the screaming frog software, so maybe try another software.

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.