What is the best practice to manage subdirectories in WordPress?
Asked Answered
V

3

8

I have a website that is written use static html pages. It contains many URLs containing subdirectories like this:

https://www.example.com/product1/order.htm https://www.example.com/product1/error/error1.htm

Now I want to create a new website via WordPress and transfer all contents from the old website to the new one.

So I wonder what is the best practice to process all these URLs with subfolders.

Should I:

  1. Keep the subfolders by using parent/child pages, like this:

https://www.example.com/product1/order.htm -> https://www.example.com/product1/order/ https://www.example.com/product1/error/error1.htm -> https://www.example.com/product1/error/error1/

Or

  1. Remove all subfolders, and chaning all URLs like this:

https://www.example.com/product1/order.htm -> https://www.example.com/product1-order/ https://www.example.com/product1/error/error1.htm -> https://www.example.com/product1-error-error1/

Or using other methods?

Thanks

Update:

With the hint of others, I get to know there are categories in WordPress. I search online and find the following URLs:

https://www.wpbeginner.com/wp-tutorials/seo-friendly-url-structure-for-wordpress/ https://www.wpbeginner.com/beginners-guide/categories-vs-tags-seo-best-practices-which-one-is-better/

So it seems using categories is a good practice to keep a hierarchy structure in WordPress. Is that correct?

Update 2

I have a question. In traiditional websites, for a product, normally the home page is https://www.example.com/product1/ , while the additonal pages such as https://www.example.com/product1/order.htm are put under the "product1" subfolder. Now in WordPress, their URLs should be:

URL1: https://www.example.com/product1/ ->(Unchanged) https://www.example.com/product1/

URL2: https://www.example.com/product1/order.htm -> https://www.example.com/product1/order/

In such a case, whether should I set product1 as a postname(for URL1) or a category(for URL2)?

Vevay answered 12/2, 2020 at 9:34 Comment(1)
The point of you moving from static to wordpress or any cms should be to optimize your website. In this reference your products should be converted to posts being custompost types (woocommerce if you gonna place real orders) . And products1/order doesnt make any sense when you have so powerfull cms such as wordpress. all products can have the ability to use order template page and dynamicly fill your product info there like a normal store would do. Doing it product1 page then order page , product2 page then order page its pointless even if you want to have different templates for each.Simmonds
R
0

Good... The WordPress directory manager is something that until now I only saw in the media gallery ... But if you want something, you can have control over the installation of Total WordPress ... In addition to database errors and PHP for free ...

It offers a range of services like PHPMyAdmin, installing WordPress via a script, file manager, whatever you are looking for ... Logging errors and even how you set up email, spam, you can see what space on the disk hard drive and RAM what kind of CPU you are using.

Configure your localhost on your domain from your server ... He's very complex, I mean, he's very complete.

It's Webmin if you are a basic user, now if you are a more advanced user ... I recommend Virtualmim these two implements that can be easily installed and also configured very quickly. It offers a variety of attributes for you to have control of your WordPress.

But it also depends on your hosting ... As they are installed via the command line / SSH, so if you don't have this option in your hosting, it gets a little more complex if you have VirtualMin or Webmin...

Randarandal answered 21/2, 2020 at 2:28 Comment(0)
R
0

I would suggest looking into registering custom post types. You can program those, or use a plugin like CPT UI. You then get a custom link structure that is e.g. example.com/products/awesome-product. This would then be the 'detail' view.

I'm not sure if you have separate order and error pages, but that could be part of the permalink structure in Wordpress as well. You might even setup rewrites for the example.com/products/awesome-product/order and example.com/products/awesome-product/error parts to have a specific page loaded, or the detail view and then have a custom layout based on these url parts.

If you used the product ID's in the old site, you could also create a custom permalink structure have it like this: example.com/products/1. That way you could easily rewrite url's in .htaccess from the old site to the new using just one rewrite rule and regex for the id's

Rossierossing answered 6/7, 2020 at 20:47 Comment(0)
E
0

i think you more or less answered your own question. But to be clear based on experience.

  1. Keep the subfolders by using parent/child pages, like this:

https://www.example.com/product1/order.htm -> https://www.example.com/product1/order/

  1. install this plugin: 'WP 404 Auto Redirect to Similar Post' Automatically Redirect any 404 page to a Similar Post based on the Title, Post Type & Taxonomy using 301 Redirects!

  2. It will find the updated pages / posts in a heartbeat.

  3. Benefits are it will also deal with all 404s, and redirect them to simular pages which helps with SEO.

  4. Its a lazy mans approach, as its one more plugin, but it works..

Evensong answered 25/8, 2022 at 18:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.