0

I am using Structure and Freebie on a recent project. I have a root-level page in Structure called “Supernav” with five sub-pages (Students, Parents, Faculty, Alumni, Galleries). When visiting any one of these subpages I would like to remove the root-level segment — in this case “/supernav/” — from the URL so it just looks like this:

http://website.com/students/
http://website.com/parents/
http://website.com/faculty/
http://website.com/alumni/
http://website.com/galleries/ 

For the life of me I can’t figure out how to do this with Freebie. Any suggestions? Appreciate any help I can get.

4

Try doing this in your .htaccess file. This StackOverflow answer shows how. Something like this:

RewriteEngine on
RewriteBase /

RewriteRule ^/(students|parents|faculty|alumni|galleries)/(.+)$ /$1 [L,QSA]

The Router addon may also work for you.

Router is a regular expression based routing system for ExpressionEngine requests. It allows you to define any custom URL route you like, without needing to worry about template naming and without using large conditional checks.

Router will automatically include the correct template for you, based on which of your regex patterns match the current URL. This can help avoid massive conditional {if} trees.

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.