0

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 Answers1

0

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.

clapas
  • 1,768
  • 3
  • 16
  • 29
  • Thanks Clapas, I think you may have slightly misunderstood my question though. I already have domain.com/blog/media-tags/results displaying the tagged media but that's not how I want it. I want to remove the 'blog' word from 'media-tags' pages (and only 'media-tags' pages). I don't want to remove 'blog' from the url when on other standard blog pages (posts, categories, tags). Hope this is a little clearer? – user2051970 Mar 03 '13 at 14:09
  • @user2051970 If you want to redirect the user, e.g. `domain.com/blog/media-tags/results` gets redirected to `domain.com/media-tags/results` you need an additional **redirection rule** but still need the above rules for your server to find the contents. – clapas Mar 03 '13 at 14:18
  • Thanks Clapas. How would I write the redirection rule please? – user2051970 Mar 03 '13 at 16:12