Mobile app version of vmapp.org
Login or Join
Speyer207

: 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.

@Speyer207

Posted in: #301Redirect #CrawlErrors #Htaccess

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]

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Speyer207

2 Comments

Sorted by latest first Latest Oldest Best

 

@Angie530

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.

10% popularity Vote Up Vote Down


 

@Eichhorn148

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme