1

I have some pages on a Wordrpress site as www.example.com/title-of-the-page

For my SEO activities I would like to add a prefix to those pages. They will be www.example.com/name-of-the-prefix/title-of-the-page

They are some dozens, so I would like to do it only on some pages, not to all pages of the site.

I would like to rewrite them all at once, not one by one, and I need to know how to do it from the file htaccess or somehow else.

  • 1
    You could introduce prefix by having category and changing URL structure. And if you do so you need to manage old url redirection to new one explicitly. – TopQnA Jun 4 '17 at 12:40
  • You'll need to do this within WordPress, not .htaccess. WP will need to know about the "canonical" URL so it can create links correctly. – DocRoot Jun 4 '17 at 17:14
  • @TopQnA these kind of posts I would like to change, they are a "custom type of posts". I think they are similar to a category, but without a custom url – bobrock4 Jun 5 '17 at 9:20
  • How do the URLs differ from the URLs that you don't want to redirect? Is there a pattern to either the URLs that need to be redirected or to the ones that don't? Do the ones not to redirect have physical files that exist? Unless you can anagrammatically differentiate them somehow, you can't do a single rule. – Stephen Ostermiller Jun 5 '17 at 11:13
  • @StephenOstermiller i) the difference between the old ones and the desidered urls is that the desidered ones are /prefix/seo-friendly-url-old-one-page-1 ii) no patterns: the old urls are all seo-friendly and different one from the other ones iii) every old urls are singles pages iv) I don't need a single rule (even if I'd prefer it), but I don't like to rewrite them one by one entering in every pages from wordpresss changing them – bobrock4 Jun 5 '17 at 14:42
1

Create a page named under hte prefix you want (my-prefix). then go to the page you want to add the prefix and add this page as a parent from the drop down menu in the right column.

  • There is the drop down menu in the right column any more. This Wordpress has been customized. This kind of pages I would like to add a prefix in the url, they are a "custom type of post" – bobrock4 Jun 5 '17 at 9:18
  • what you mean custom type of post? – xbass540 Jun 6 '17 at 1:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.