Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Slash appear at the end of every url

Problems with slash appearing at the end of every url on my website.

11:16 pm on Mar 23, 2013 (gmt 0)

New User

5+ Year Member

joined:Apr 2, 2010
votes: 0

I have problem with my website because Google is reporting duplicate content on it, even if those pages (static pages) don't appear on the server. For example if I have page at this location (this is static and not dynamic page)


google also reporting this page


and this page


this slash (/) appear at the end of every page on my website. Anyone knows what is causing it to appear and how to get rid of it? I did checked .htaccess file and he is not causing this problem.

Thanks for help.
1:46 am on Mar 24, 2013 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
votes: 552

I did checked .htaccess file and he is not causing this problem.

It may not be causing the problem, but it may be failing to prevent the problem.

In ordinary static html, directories have slashes at the end and files don't. If your site is made up of php files built on the fly, then you need to transfer the slash-checking job to the php itself. Whenever there is a request for anything that doesn't exist-- including pages with name ending in ".php/" --your php has to return a 404.

If your filenames end in php but are essentially static, you can handle it the same way you'd handle it with html. Does this type of URL

really occur? If not, make a single conditionless rule that says something like
RewriteRule ^(([^./]+/)*[^./]+\.(html|php))/ http://www.example.com/$1 [R=301,L]

No closing anchor, so there might be extra stuff after the superflous slash. I have this rule on my test site, though so far I haven't needed to add it in real life.
2:05 pm on Mar 24, 2013 (gmt 0)

New User

5+ Year Member

joined:Apr 2, 2010
votes: 0

brilliant, your rewrite rule inside .htaccess works.

thanks a lot!
4:34 am on Mar 27, 2013 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 2, 2006
votes: 6

I had the same problem some time ago. It created thousands of non-existent pages across one of my sites.
This is what I used:

RewriteRule ^([^.]+\.+html)/$ http://www.example.com/$1 [R=301,L]

I guess lucy24's way of doing it is more comprehensive, so stick with it.
In Google WMT, just select all of the pages that appear, and mark them as fixed. Don't get surprised if many of new ones start appearing every day.

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members