Viewing 10 replies - 1 through 10 (of 10 total)
  • I have several questions for you.

    Why and how did you do the redirect? The 404 is because the you are looking at the category ‘self-help-ideas’ and under that category there is no post ‘look-after-your-back’

    But lets forget that you did a redirect. You could have tried opening the page (which you want to remove) as to edit it then select the whole page (right click Select All) and copy it. Then open a new post with the title you wanted and pasted everything in there. That will give you new page with the title you want.

    I do not know whether this will help you.

    Thread Starter alisonn

    (@alisonn)

    Thanks for answering

    First I did the redirect manually using an htaccess file, then tried a plugin (404 Redirected). I need the redirect because the urls are different for pages than posts. Here’s my original page url:
    https://www.massagetherapies.co.uk/self-help-ideas/look-after-your-back
    And here’s the new post url which I used for the redirect:
    https://www.massagetherapies.co.uk/2013/01/look-after-your-back/

    For some reason the redirect is generating a url that doesn’t exist (https://www.massagetherapies.co.uk/category/self-help-ideas/look-after-your-back/ – WP doesn’t usually create url structures like that)

    I don’t understand why this is happening ??

    I am trying to figure this out but it looks like the top right menu for pages has an option ‘self help’ which is not a page but a category. I assume your categories are ‘Avoid injury and pain’, ‘Between Treatments’, …etc.

    Your post are like https://www.massagetherapies.co.uk/2013/01/look-after-your-back/ because your permalinks are set to ‘month and name’. I think your were wanting it to be post name. Go to WP control panel, to Settings > Permalinks and select ‘Post name’ radio button. Uninstall the plugin (404 redirect) first before you change the permalinks … this is just to see if you are getting what you want with any redirection.

    I should have firstly asked you whether you wanted your post URL’s to look like

    https://www.massagetherapies.co.uk/2013/01/look-after-your-back/ … with month and date

    or
    https://www.massagetherapies.co.uk/self-help-ideas/look-after-your-back … without month and date

    For some reason ‘self-help-ideas’ is being classified as a category instead of a page and is probably because of the 404 redirect plugin is try to build a probable post or page the visitor is looking for and ends up generating a non existent page/post.

    Can you try it without the plugin and see what happens? What are the links generated?

    I went back to read your original message and if I understood it correctly you were trying to remove the ‘self help’ pages and make it posts, right?

    Thread Starter alisonn

    (@alisonn)

    Yes that’s right, I’m trying to remove the ‘self help’ pages and make them posts.

    I created a self-help category – that link in the navigation is to the category listing page. It used to be a manually created page. (The redirect for that works fine.)

    It’s the individual posts that are the problem. btw I don’t think that there’s an option to have a category in the url of a post, just an undated post e.g. https://www.massagetherapies.co.uk/look-after-your-back/

    Can you try it without the plugin and see what happens? What are the links generated?

    Not sure what you mean by this

    Ok, let me try and explain this step by step and I hope it works for you. I could not test in on my WordPress sites as both my database servers are down today. But i did test it out one my non-WordPress site (php scripts site) and it worked very well. But you must have access to your .htaccess file on your server for the method below to work.

    1. Deactivate the 404 redirect plugin as you do not want it interfering while you are trying out a different way of redirecting your back links. By this I mean that other sites having back links to your pages cannot be changed to back link to your posts. But we can change what page or post they receive when they come to your site.

    2. In WordPress Control Panel go to Settings > Permalink and set it to to ‘Post name’ – click on the radio button. That should change your the urls of your posts from something like

    https://www.massagetherapies.co.uk/2013/01/look-after-your-back/

    to something like

    https://www.massagetherapies.co.uk/look-after-your-back/

    which is easier to manipulate and redirect. Just test this out and see the results. If this is what you see then carry on to the next step.

    3. If you already have a post which is a copy of your page & with the same title, then edit your .htaccess file and put the following lines of code right at the top before the WordPress lines of code. … before WordPress line of code so WordPress also receives the redirect page url’s.

    RewriteEngine On
    Redirect /self-help-ideas/ https://www.massagetherapies.co.uk/

    What this does is that all request for pages in the /self-help-ideas/ ‘directory’ are rerouted to root level. Don’t put ‘https://www.massagetherapies.co.uk’ in-front of ‘/self-help-ideas/’ in the code above as some visitors may visit ‘https://massagetherapies.co.uk/’ and you want the redirection ‘with the www’ and ‘without the www’ to work. So if someone requests for a page like

    https://www.massagetherapies.co.uk/self-help-ideas/look-after-your-back

    They are shown a post with the same title as:

    https://www.massagetherapies.co.uk/look-after-your-back

    If this works for one page and its corresponding posts then you can copy and paste all your pages to posts with the same title. (without the /self-help-ideas/)

    Once you are sure all pages/posts work properly and you can delete all those pages.

    I would suggest you make a back up of your site (db and files) before you do anything just in case you mistype something. If you have no access to the .htaccess file then ask your server tech support to add the lines into your .htaccess file (at the top).

    I do hope this is what you were trying to achieve and this is what you wanted. Sometimes we misunderstand the problems and can go off track with our replies.

    I just remembered … you may want to copy all your pages under /self-help-ideas/ to posts before you try the above out or else you may not see any of those pages.

    And if you want to deactivate those two line in the .htaccess file put a # infront like this

    #RewriteEngine On
    #Redirect /self-help-ideas/ https://www.massagetherapies.co.uk/

    Thread Starter alisonn

    (@alisonn)

    Thanks very much Peter – I’m out today but will try this out this evening

    Thread Starter alisonn

    (@alisonn)

    No luck with that – thanks though

    Sorry I was done with a bad cold and fever and my doctor gave me medication that made me sleep the whole day … actually 4 days straight.

    I did not understand you comment. When I checked your site it still uses …/month/day/… as the url. If you change the permalinks to psotname I could see how to help you.

    Thread Starter alisonn

    (@alisonn)

    Hope you’re feeling properly well again

    After I’d seen that a simple post name url and redirect file didn’t solve the problem, I set the urls back to /month/day/.

    I’m not too happy with changing things on the live site unless strictly necessary so I went to my development site to try things out and found that on the dev site the redirect is happening automatically! So I think that the problem must be that I’ve mucked up WordPress’ canonical auto-redirects somehow.

    Have managed to find someone who thinks he can help me out with this. So will post back what we discover when we find out what the problem is.

    Thanks for your help though – much appreciated.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Page to post redirects not working’ is closed to new replies.