Redirection 301 advice needed

0 replies
  • WEB DESIGN
  • |
Hi guys,

I'm going to be replacing my current site with one that I'm creating in Wordpress soon, but I will have a lot of links that will need to be redirected. This has thrown up some questions that I'd appreciate some advice on.

1. My current urls are in the format http://www.mydomain.com - whereas the new Wordpress will be http://mydomain.com. I found the following code which seems to deal with canonicalization issues, and I'd like to check that it would be appropriate in my case?

It seems to be more for situations where the original url has omitted the www which isn't true for me, although the destination url won't have the www. Confused!

Code:
RewriteCond %{HTTP_HOST} ^mydomain.com [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [L,R=301]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /([^/]+/)*(default|index).(html|php|htm) HTTP/ [NC]
RewriteRule ^(([^/]+/)*)(default|main|index).(html|php|htm)$ http://www.mydomain.com/$1 [L,R=301]
2. I have a lot of pages inside a gallery directory - eg

http://www.mydomain.com/magicgallery/img001.php
http://www.mydomain.com/magicgallery/img002.php etc.,

Is there a wild card directive available for redirecting the entire contents of a folder? That will save me a lot of time if there is!

3. I'm going to be using Wordfence. The plugins cache facilty rewrites the .htaccess file and makes it quite lengthy. I'm not really sure where in the file I would include the redirects. Anybody have experience with Wordfence that has included redirects?

I can always raise the third question on the Wordfence support forum, but it would be great if someone can advise on the first two.
#301 #advice #needed #redirection

Trending Topics