Jump to content

301 Redirect Issues


Nate C.
 Share

Recommended Posts

Hello All, I was hoping someone could help me with a Redirect issue. I have a new site created that is replacing an old version. We got rid of a bunch of subpages and are trying to get the old URLs to relink to the corresponding new pages. This works on some of them, bringing them back to he main page and a certain section (its a one page scrolling site for the most part) but the ones that are supposed to go to the sub-pages are not working.

I have tired a bunch of different permutations with no luck. The old site used Wordpress and the current one does not, if that is a factor. This is my first real site-build, so any help would be greatly appreciated - thanks!

Here is the code I am trying to use, the redirects work properly up through the 'Careers' section:

Options +FollowSymLinks
RewriteEngine on

#301 Redirect Old File
Redirect 301 /contact http://www.mngdirect.com/#contact
Redirect 301 /about http://www.mngdirect.com
Redirect 301 /careers http://www.mngdirect.com/#careers
Redirect 301 /our-team http://www.mngdirect.com/#teams
Redirect 301 /about/careers http://www.mngdirect.com/#careers
Redirect 301 /solutions/eventdirect http://www.mngdirect.com/eventdirect
Redirect 301 /solutions/marketingdirect http://www.mngdirect.com/marketingdirect
Redirect 301 /solutions/eventdirect/eventdirect-peer-to-peer/ http://www.mngdirect.com/eventdirect
Redirect 301 /solutions/eventdirect/eventdirect-advisory-board/ http://www.mngdirect.com/eventdirect
Redirect 301 /solutions/eventdirect/eventdirect-broadcast/ http://www.mngdirect.com/eventdirect
Redirect 301 /solutions/eventdirect/eventdirect-speaker-training/ http://www.mngdirect.com/eventdirect
Redirect 301 /solutions/marketingdirect/marketingdirect-triggered-formulary-campaigns/ http://www.mngdirect.com/marketingdirect
Redirect 301 /solutions/marketingdirect/marketingdirect-triggered-attendee-campaigns/ http://www.mngdirect.com/marketingdirect
Redirect 301 /solutions/marketingdirect/marketingdirect-scheduled-speaker-campaigns/ http://www.mngdirect.com/marketingdirect
Redirect 301 /solutions/marketingdirect/marketingdirect-scheduled-target-campaigns/ http://www.mngdirect.com/marketingdirect
Redirect 301 /solutions/marketingdirect/marketingdirect-triggered-rep-campaigns/ http://www.mngdirect.com/marketingdirect
Redirect 301 /solutions/marketingdirect/marketingdirect-triggered-behavior-campaigns/ http://www.mngdirect.com/marketingdirect
#RedirectMatch 301 ^/solutions/ http://www.mngdirect.com/#solutions

#error 404
ErrorDocument 404 /404.html

-Nate

Link to comment
Share on other sites

1 hour ago, Nate C. said:

The old site used Wordpress and the current one does not, if that is a factor.

The operating assumption here is that you are using Processwire, so yes, it is a factor.

If this assumption is true, then you'd simply need to use the fantabulous Jumplinks module.

And also it is curious that your target URLs do not have trailing slashes, which is the default for PW.
If you have not changed the default behavior, then you'd be getting a 2nd unwanted 301 redirect to the trailing slash.

  • Like 2
Link to comment
Share on other sites

I would also go for the Jumplinks module. One great feature is that you can mass upload a CSV file with all the pages that you would like to redirect. After that you can check how often the old link has been redirected to the new location and perhaps remove the redirect when it isn't being used anymore.

  • Like 1
Link to comment
Share on other sites

13 hours ago, Nate C. said:

This works on some of them, bringing them back to he main page and a certain section (its a one page scrolling site for the most part) but the ones that are supposed to go to the sub-pages are not working.

If you still want to go with the .htaccess route instead of Jumplinks, you might want to provide us some additional information. What I mean is that, for an example, /solutions/eventdirect should definitely redirect the user to http://www.mngdirect.com/eventdirect. Are you saying that this redirect doesn't happen at all?

Another thing I find curious is the placement of these redirects in your .htaccess file: here you've got "RewriteEngine On" right after "Options +FollowSymlinks", but in the default .htaccess setup "RewriteEngine On" is placed much later in the file. Did you alter the .htaccess file and add *additional* "RewriteEngine On" row, or how did you end up with this setup?

Which version of ProcessWire are you using, by the way? :)

  • Like 2
Link to comment
Share on other sites

One thing I notice -- you should reverse the order of your rules.
 You have the generic ones before the specific ones. so a request to

/solutions/eventdirect/eventdirect-advisory-board/

will never be resolved, because the more generic condition

/solutions/eventdirect/

will always be reached first, so "eventdirect-advisory-board" will not be reached at the new location.

cheers,
Tom

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...