WP Page and Subdirectory with same name

You’ll need to do some .htaccess-fu to get what you’re proposing to work.

RewriteCond $1 ^/labs/(.+)
RewriteRule ^/labs/(.*)$ /labs-folder/$1 [L]

This isn’t tested yet but it if you put it before the wordpress rules in your htaccess file it will remap urls that begin with /labs/ to /labs-folder/ but not if the url is just “/labs/” on its own.

Let me know if it doesn’t work and I’ll debug it with you.

You can replace “labs-folder” with any folder name you choose but essentially a url like:

http://example.com/labs/project1/

Will really be looking here:

http://example.com/labs-folder/project1/

Leave a Comment