MyBB Community Forums

Full Version: RewriteRule - showthread.php - googlebot indexing problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Here's my problem. I'm using SEO links and the URL are changed:

RewriteRule ^(.*)-t-([0-9]+).html(.*)$ showthread.php?tid=$2$3 [QSA,L]
RewriteRule ^(.*)-t-([0-9]+)-([0-9]+).html$ showthread.php?tid=$2&page=$3 [QSA,L]

For example:

As you can see from the above link the rewriting works and google should index my page correctly. The problem is that I saw in the webmaster tools lots of errors (duplicate pages, titles etc) because of this:


There's a folder after the site name "any-waller" !!! and the rewriting doesn't get rid of this folder. I don't know how or where google found the reference to this but now I got lots of duplicate pages. Also notice that in the mybb forum all links are changed and they also contain the folder name - this error will propagate !

My question ? Is there a way to modify the rewriterule so that showthread.php will redirect directly to blablabla-t-x.html without any other folder in front ?

Thanks !

Well, to get rid of the /, just replace .* with [^/]*

Doesn't stop anyone from using funny names to link to you (and have the link actually work).

Consider using Google SEO instead; unlike the other SEO plugin it's still maintained, doesn't suffer from this particular problem, and redirects links and uses canonical meta tags to avoid duplicates.
Thank you ! That was exactly what I was looking for Smile I don't want to use another seo plugin cause I made some modifications (template edits but mostly php edits) and I won't know where to start when errors show up. I use a canonical plugin already.