Hi friends, My all site urls are dynamic & written by using RwriteRule in .htaccess file. All the url are like this, mysitename/page1/ mysitename/page2/ and so on Problem is that, I have few backlinks like, mysitename/page1 mysitename/page2 whenever i open my webmasters tools under Crawl errors, these links count as Not Found. How should i change my rewrite url to show mysitename/page1 page as mysitename/page1/ my current rewrite rule is as bellow. RewriteEngine On RewriteRule ^([^/]*)/$ /detail.php?requested=$1 [L] Thank You!
Make the slash optional; right now your match is insisting on it. ^([^/]*)/?$ detail.php?requested=$1 So match anything that's not a slash, and then maybe a slash (for the end) the /? is kept out of the matched part and made optional.
I should have added another slash after your real url: RewriteRule ^([^/]*)/$ /detail.php?requested=$1/ [L] Code (markup): with the / after the $1. If that doesn't work, I can show you this one from askapache that I thought went really far and I dunno your setup... but if you can try this offline/test! or something and see if it works for you: RewriteRule ^/*(.+/)?([^.]*[^/])$ http://%{HTTP_HOST}/$1$2/ [L,R=301] Code (markup): But I noticed your current rewrite didn't start with ^/ but just ^... apparently it matters which version of Apache you have (1.3 or 2.x)? It also does a permanent redirect for that slash, so that robots should notice and update their cache that the url is always with a / The above also takes care of longer urls: example.com/something/lastfile/ where in the rewrite above (.+/)? can match "something" source I've never used it myself, I've just had the optional trailing slash in my matches.