What is the best practice to manage subdirectories in WordPress? - wordpress

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:
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
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)?

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...

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

i think you more or less answered your own question. But to be clear based on experience.
Keep the subfolders by using parent/child pages, like this:
https://www.example.com/product1/order.htm -> https://www.example.com/product1/order/
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!
It will find the updated pages / posts in a heartbeat.
Benefits are it will also deal with all 404s, and redirect them to simular pages which helps with SEO.
Its a lazy mans approach, as its one more plugin, but it works..

Related

Export WordPress complete URL list for redirects (website migration)

My WordPress website is completely rebuilt with AEM. The WordPress instance will be taken offline and the AEM instance will go online. With the same domain but the url structure will no longer be the same as also the structure of the website will be new.
Problem: This will cause various WordPress URLs to generate a 404 error later.
My goal: I want to export all WordPress URLs as CSV structured and can therefore set up redirects. Structured means as far as its possible:
A separation is made between pages and posts
Public pages only
etc.
Here is the question: What is the best way to export them and that they are also structured? Is there a plugin, just take a sitemap, maybe Google Search Console or directly from the database?
You can try using export-all-urls plugin. Below links will help you export the URLs.
https://wordpress.org/plugins/export-all-urls/
https://www.greengeeks.com/tutorials/article/how-to-export-wordpress-urls-to-text-or-csv-files/
If you have a pattern in the existing URLs, then you might not have to add rewrite rule for each and every URL. Instead use regex to map all URLs following the pattern to AEM URLs.

Install wordpress on subdomains

I need some help with wordpress. I have got a wordpress on my main domain and I would like to use another wordpress on my subdomains with the same theme, plugins, blog pages and posts but different links in my blog posts. I want to know how I can change the links in my blog posts for the main domain and the subdomains?
Do I need to create a subdirectory folder and a different database name for each subdomain and do I also need to copy the wordpress files from the main domain to the subddirectories folder so I could be able to create the username and password for the subdomains and then login in the wordpress for each subdomain to change the links in the blog posts?
I want you to understand that I want to use the main domain and subdomains to use the same theme, same plugins, same blog posts and same pages but the links in the blog posts have to be different, because I am going to use different traffic sources on each subdomain to track for clicks and sales, example: my main domain will be use for google traffic, the blog subdomain is for facebook and the other subdomain is for easyhits4u. I can track the clicks and sales for google and other traffic sources because the links in the blog posts for the main domain and subdomains would not be the same.
If I use the same links in the blog posts for the main domain and the subdomains, I would not know how many clicks and sales I would get from each traffic source I use and I would not know where the clicks and sales are coming from. That is why I want to use it seperate so I can track it easy.
To go a little further about the comment of #Sysix :
As far as I know, Wordpress Multisite allow you to have one folder that hold all of your websites. Your websites url can be subdomains or subfolders based (but this one not need to have a real subfolder, it's only about the url)
subdomain.example.com
example.com/subdomain
At my last work, the php developper made a plugin or something that allow you to have different urls for each site of the network.
example.com
example2.com
etc.
(I'm gonna search some informations about it, if you are interested in)
Websites are handled with the database only, and if you take a look at the wordpress database after you have create a new site in the network, you will get new tables wp_posts, wp_meta etc. with a number after them that is related to the site id.
So i think that the best way for you is to make one website, create all the post, the pages, and when it's done, duplicate it in a new site in the network.
You can use the plugin in the link below to duplicate a site of your network.
https://fr.wordpress.org/plugins/multisite-clone-duplicator/
Just a warning : I know that this way it could works, but I also know there some conditions to make it works great. I can't remember exactly why but I seem to recall that you can't easily duplicate the main website of the Network. There was a workaround to do it but I don't remember exactly what was the issue, and how to resolved it.
I'm gonna search and test some stuff right now, so this answer is not definitive but it could get you on the way. I will edit it if i find or remember some important thing.
Sorry for this answer that is not really an answer, but in comment it was not possible to write all this ... Also if I said nonsense, please correct me, and I will edit the post as well.

How to implement wordpress blog and magento blog parallely

I have a single instance of Magento running. I am using wordpress blog in magento and want to use magento "Blog" parallely. When i use both blogs magento blog overrides wordpress blog section. Can anyone tell me how we can solve this problem.
You can see the link http://dev.dynatrac.org/ where i want to use this section.
Thanks
Instead of using URL http://dev.dynatrac.org/index.php/blog.html, you can use http://dev.dynatrac.org/blog/ and put the wordpress installation in the blog directory of your magento root.
Now using .htaccess or nginx conf (depending upon whether you use apache or nginx) you can redirect the URLs in the form of http://dev.dynatrac.org/blog/something_something.html to blog/ directory.
Unfortunately, the AW_Blog extension uses 'blog' as it's router frontName. This overrides the Magento WordPress Integration extension, making the 2 incompatible. In an ideal world, AheadWorks would modify their extension to use a different router frontName (eg. aw_blog) and then would display the blog using a dynamic route (in the same way that Magento WordPress Integration does), thus allowing both extensions to function at the same time.
My advice would be to remove AW_Blog and instead, make use of the Custom Post Types add-on and Root.
The Custom Post Types add-on allows you to create custom post types in WordPress and display them on your Magento integrated blog. As an example, lets say you display your standard blog posts at /blog/ but wanted to create a different type of posts (eg. News articles). You could setup a custom post type called 'news'. By default, this would display all of your news posts at /blog/news/. To improve this, you could install Root, which would remove the /blog/ from the URL, meaning your news articles would be available at /news/.
This method allows you to create what appears to be multiple different blogs but is actually a single WordPress blog that makes use of different custom post types. This method will allow you to have as many different post types as you require.
EG.
http://www.yourmagento.com/blog/
http://www.yourmagento.com/news/
http://www.yourmagento.com/recipes/
http://www.yourmagento.com/tutorials/
All of these would be powered from 1 WordPress installation and integrated into Magento.

Drupal installation and domain naming strategy?

I have a my main site, called "mysite.com" (for arguments sake). On this site, you will find my blog and everything I do. But I am starting another site that I want to run on my domain. However:
The other site must have it's down domain name: newsite.com
If people go to mysite.com/newsite it must redirec to newsite.com
If people go to newsite.com, it must show the content of what they would see if they had gone to mysite.com/newsite in the past
So basically, I want a "page" or actually a whole section ( mysite.com/newsite/* ) to appear as newsite.com in the browser.
Why?
I want both sites to run off one drupal installation
I want both sites to look basically the same
However, keep in mind that I don't want to use a multi-drupal solution. i.e. a module that allows for more than one copy of drupal to run off 1 installation.
http://drupal.org/project/domain allows you to configure various things based on the domain, for example accessible nodes.
You can probably do the redirect with a Rewrite Rule, outside of Drupal or write a simple module that does that.
Sounds simple to do. Just install the second site using a regular multi-site installation. (Google "drupal multi-site instructions"). Then install the Path redirect module and create the external redirect to the new domain. http://drupal.org/project/path_redirect

Wordpress, why doesn't my blog load the posts if U use the /subfolder domain method?

I have a blog at http://hamids-it.elaosta.com amongst others. If I try to access it from
http://elaosta.com/hamids-it it loads the blog but says it couldn't find the page I wanted.
How do I fix this so I can use either?
I'm guessing you have a standard subdomain install, whereby http://subdomain.example.com is mapped to the directory /example.com/public_html/subdomain?
In any normal circumstance, say with a static HTML file, you can rightly access the same resource at both example.com/subdomain/resource.html and subdomain.example.com/resource.html.
However, in your case, WordPress is parsing the REQUEST_URI and using it to determine what to show.
So in the case of http://elaosta.com/hamids-it, WordPress is actually looking for a page 'hamids-it' - and if it doesn't find it, voila, your 404.
The fix?
You'll need to decide which way you want to access your blog, subdomain or sub-directory, then stick to it.
When you've made a choice, update your General settings in WordPress admin and set both address URL's to either http://hamids-it.elaosta.com or http://elaosta.com/hamids-it.

Resources