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

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Similar Content

    • By anthonygustin
      Hey all, things had been going well remapping a site from one domain to another, but hit a snag and have searched for hours and don't know how to continue. 
      1) I was moving everything from thepaleofix.com to dranthonygustin.com
      2) I moved every single path individually with redirects like this: Redirect 301 /category/post http://www.dranthonygustin.com/category/post
      Everything smooth sailing until today when through webmaster tools (to say site address as moved) I had to execute "Redirect 301 / http://www.dranthonygustin.com" -- now some of the urls go through and some don't include the / after the .com extension. 
      For example:
      http://www.thepaleofix.com > http://www.dranthonygustin.com no problem 
      http://www.thepaleofix.com/resource/purepharma-m3-review/ > http://www.dranthonygustin.com/what-does-magnesium-do/ no problem
      BUT a bunch of the URLs then don't push... For example:
      http://www.thepaleofix.com/recipe/paleo-jam > http://www.dranthonygustin.comrecipe/paleo-jam/ (notice NO / after the .com extension)
      and http://www.thepaleofix.com/wp-admin > http://www.dranthonygustinwp-admin (which of course leads to dead link)

      There are a bunch of paths that do this, that I checked before and were working, such as: 
      Redirect 301 /recipe/paleo-jam http://www.dranthonygustin.com/simple-vanilla-berry-paleo-jam/
       
      Any idea why after implementing the / redirect, why it broke some of the redirects and not all? 
       
      Thanks! 
    • By mediamar
      I moved an old site to processwire and want to redirect the old URLs with php-filenames to the new folders via .htaccess to match the new structure.
      I tried:
      RedirectMatch 301 /filename.php http://example.com/filename/
      The Browser end up like this:
      http://example.com/filename/?it=filename.php
      Its interfering with that Processwire .htaccess rule
      # ----------------------------------------------------------------------------------------------- 
        # Pass control to ProcessWire if all the above directives allow us to this point.   # For regular VirtualHosts (most installs)   # -----------------------------------------------------------------------------------------------     RewriteRule ^(.*)$ index.php?it=$1 [L,QSA]   If i comment that out the redirect in the URL is ok, but every Klick on a websitelink is showing the homepage.   Any idea how i can fix this? Thanks   Andreas
    • By Xarissot
      Hi there,
      I want to 301 redirect the following:
      http://www.example.com/folder-name1/ to http://www.example.com/folder-name1/index.php/folder-name2/
      Is that possible with htaccess?
      Which code should I use
      Thanks in advance for your answers
    • By overoon
      hi,
      i have a question, which i should be able to work out with htaccess, i just wanted to ask, if there's an easier way using processwire:
      i set up a new site using processwire with multilang etc. since a lot of stuff changed on the website (contents, hierachy, ...) there's now also a different domain structure. the old structure was:
      www.example.com/outlet-1
      and now it's
      www.example.com/en/find-us/outlet-1
      is there any way i can do a (temporary) 301 redirect, without having to remodel to the whole structure? the main reason for this is, that there are still tons of flyers and other advertising materials with this domain structure (transitionphase should end in <6months)
      the whole thing comes down to about 4-5 pages -- so nothing really drastic. also if there's no way in doing this with processwire, help with a proper RewriteRule for htaccess would be greatly appreciated. current workaround doesnt really do the trick.
      thanks so far!
    • By k07n
      Hi!
      How to make 301 redirect from www.site.com/news/hereisthepost/ to www.site.com/blog/hereisthepost/ ?
×
×
  • Create New...