: Redirect pages to fix crawl errors Google is giving me a crawl error for pages that I have removed like www.mysite.com/mypage.html. I want to redirect this pages to the new page www.mysite.com/mysite/mypage.
Google is giving me a crawl error for pages that I have removed like mysite.com/mypage.html. I want to redirect this pages to the new page mysite.com/mysite/mypage.
I tried to do that by using .htaccess but instead of fixing the problem, the crawl pages increased and a new crawl came mysite.com/www.mysite.com.
This is my .htaccess file:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /sitename/
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /sitename/index.php [L]
</IfModule>
# END WordPress
Should I add this after the rewrite rule or I should do something else?
RewriteRule ^pagename.html$ www.sitename.com/pagename [R=301]
More posts by @Speyer207
2 Comments
Sorted by latest first Latest Oldest Best
Your problem may be to do with that rewritebase command.
Have you checked you redirects to see if they work properly?
I would place my custom redirects above the rewrite block of code. It makes more sense and avoids that rewritebase causing trouble. Just make sure you have a rewriteengine on before it all.
I prefer to use the Redirect command in .htaccess rather than a rewrite rule for simple redirects:
redirect 301 /pagename.html www.sitename.com/pagename
But if you would rather use a rewrite rule, your rule looks like it should be fine.
When I run WordPress, it is more convenient for me to install the Quick Page/Post Redirect Plugin that allows me to specify all the redirects from the WordPress admin interface. I also install the True Google 404 Plugin that keeps track of 404s in the admin interface so I know which redirects to add.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2025 All Rights reserved.