0
votes

It's a wordpress site. I am using a plugin called media tags. This plugin create a custom taxonomy called 'media tags' to display media that has been tagged. The url for these pages are currently domain/blog/media-tags/results

I would like to remove the blog part only when on a media-tags page. So I end up with:

domain.com/media-tags/results

but the standard blog posts,categories & tags still keep the blog part of the url:

domain.com/blog/cat/post-title, domain.com/blog/cat, domain.com/tag/post-tag

Is this possible please?

1

1 Answers

0
votes

I'm assuming you just need a snippet for your .htaccess file.

RewriteEngine on

# condition to avoid recursion:
RewriteCond %{REQUEST_FILENAME} !blog
# your rewrite rule:
RewriteRule media-tags blog/media-tags

When the server receives a request to domain.com/media-tags/results it will rewrite the target URL as domain.com/blog/media-tags/results.

I guess you will also have to configure your plugin to point the URLs to the root directory of your server. From the Media Tags plugin homepage:

You can also change this ‘/media-tags/’ URL parameter to something of your liking like ‘/gallery/’. To do this log into wp-admin and go to the Permalinks page under Settings. At the bottom of the page you will see the input field for Media-Tag. Simply enter your preference and update the page.