I'd like to take any URL where segment_1 == "supernav" and remove that segment. So this:


Would become this:


How can I do this?

  • 1
    Are you trying to simply hide the segment from your template, or redirect users from one URL to another? Dec 16, 2012 at 0:37

3 Answers 3


I'd create a template group called supernav, and put this in its index template:


(If there's no 3rd segment present, EE will ignore it.)

  • Tricky part is I'm using Structure, so templates are quite used the same way... Dec 17, 2012 at 15:48

If you're not actually talking about doing a redirect (it's not quite clear from your question for me) then you may want to consider using Freebie for this:


In the freebie extension settings you can set supernav to be ignored so, any time you hit http://alpha.ced.berkeley.edu/gallery/ you are really hitting http://alpha.ced.berkeley.edu/supernav/gallery/

And of course you would make sure in your hrefs that you removed supernav/.

  • I've tried Freebie and I can never seem to get it to work correctly. Not sure why. Dec 17, 2012 at 15:44

Here are a couple mod_rewrite options to try in your .htaccess file to remove the "supernav" segment of your URL:

RewriteEngine On
RewriteBase /
RewriteRule ^supernav/gallery/$ /gallery [L]


RewriteEngine On
RewriteBase /
RewriteRule ^(.*)$ supernav/$1 [L]

Worth taking a look at...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.