Pretty URLs and excludeprefix page aliases

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
mran
Forum Members
Forum Members
Posts: 20
Joined: Sat Oct 06, 2007 5:47 pm

Pretty URLs and excludeprefix page aliases

Post by mran »

I've been writing a site with a dual menu system, which uses the 'excludeprefix' tag {menu excludeprefix='left'} to sort the pages into their appropriate menus.  This is totally fine until I enable pretty URLs, and then I get something like this:

http://mysite.com/top-plan-visit/top-school.html

This is not really terrible, but I'd love if someone can point me to a rewrite rule which can strip out those prefixes.  I'd like to remove "top-" and "left-"

Right now, my rewrite rules look like this:

Code: Select all

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
I know this is different from what is given in the example .htaccess.txt and in the doc, but this is the only configuration that seems to work on my host.

Thanks if anyone has a suggestion.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: Pretty URLs and excludeprefix page aliases

Post by Rolf »

Hi mran,

Have you tried to use two different menu trees in the admin, in stead using the prefix?

1 top-nav
  1.1 page 1
  1.2 page 2
  1.3 page 3

2 left-nav
  2.1 page a
  2.2 page b
  2.3 page c

And in your template something like:
Top menu
  {menu start_element='1.1' show_root_siblings="1"}
Left menu
  {menu start_element='2.1' show_root_siblings="1"}

Grtz. Rolf
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Post Reply

Return to “CMSMS Core”