Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Move pages to subdirectory in Wordpress

I have a Homepage setup made with wordpress. All pages are in the root directory:

www.example.com/

is it possible to move some of my pages to a subdirectory ?

like:

www.example.com/products/

It is important that the root directory stays the same.

like image 845
jublikon Avatar asked Oct 12 '15 16:10

jublikon


People also ask

How do I move a WordPress site to a subdirectory?

Click "General" on the dashboard on the left side of the screen. Change the address to the new directory in the "WordPress address (URL)" box. For example, if you want to have WordPress run in the subdirectory "blog," type "http://yourdomain.com/blog." Keep the Site Address (URL) field the same. Click "Save Changes."

How do I create a subfolder in my website?

Make a subdirectory in your WWW root dir that can be accessed by the user that your webserver runs under with the name that you want to put after your domain (ex: www.mysite.com/thisisthedirnameyouuse/afile.html ), and put the files in there. Ryan J means 'make a new folder' when he says 'subdirectory'.

What is the difference between directory and subdirectory?

Files are organized by storing related files in the same directory. In a hierarchical file system (that is, one in which files and directories are organized in a manner that resembles a tree), a directory contained inside another directory is called a subdirectory.


1 Answers

Here is simple way to do it.

Create a blank page in WordPress called "Products".

Then for all other pages, select "Products" page as "Parent" page.

Now new url of the page will be like:

yourrootdomain.com/products/page-name

Do the same for all pages you want under the "Products" base/directory slug.

Let me know if you cannot get it working or don't understand it or it does not solve your issue.

Here is how to select Page's parent in page attributes section on add or edit page screen:

https://en.support.wordpress.com/pages/page-attributes/#parent

like image 134
Mohsin Avatar answered Oct 11 '22 04:10

Mohsin