Subdirectory publish

Shifter now supports installing WordPress into a subdirectory.

Tomohyco Tsunoda avatar
Written by Tomohyco Tsunoda
Updated over a week ago

What is Subdirectory published?

If your main site is hosted elsewhere, you may now publish a Shifter site as https://example.com/my-shifter-site/  without publishing to your main site's server.

Note: No nested subdirectory supported. The only single subdirectory is supported.

 

Enabling Subdirectory Publish

1. Navigate to [Live] menu of the website

2. Navigate to [Subdirectory] menu

Subdirectory publish is disabled by default.

3. Enable the toggle switch, then input your desired subdirectory name and click [update]

4. Subdirectory publish is now enabled

5. Navigate back to your site's [Overview] page. Then, start WordPress.

 WordPress will now operate as a subdirectory install.  

6. Generate a new artifact and publish it.

7. Your sites artifact will now be published in a subdirectory. 

 

Some notes on enabling subdirectory support

The path of the media files on your posts will not be changed wether you change the name of the subdirectory. You should rename or replace it manually.

For instance, if you update the name of your subdirectory from name-of-subdirectory to renamed-subdirectory or you simply delete the subdirectory name from the Shifter dashboard, the paths to the media files on your posts will still exist as name-of-subdirectory .

Example

Current subdirectory name: name-of-subdirectory 

  • Path to media: /name-of-subdirctory/wp-content/uploads/2019/12/example.png 

New subdirectory name: new-name-of-subdirectory 

  • A new path to media: /name-of-subdirctory/wp-content/uploads/2019/12/example.png 

Subdirectory Disabled: 

  • A new path to media: /name-of-subdirctory/wp-content/uploads/2019/12/example.png  

Solution

  • You can rename the media file paths by using a search and replace plugins such as Better Search Replace or Search Replace.

  • If you only have a few media files, you can rewrite the path directly within the Block Editor (use Edit as HTML feature)

  • Be sure to replace your file url with the same path as your updated WordPress subdirectory name.

Be sure to generate and publish a new artifact to see your subdirectory settings reflected on your published site.

Did this answer your question?