Hiding a parent page from url string.

Permalink
Hi people..

I have a need to hide a page from the sitre tree in the url.

I have a page url www.www.website.com/essex/chelmsford... - I wish to hide /essex/ when on the Chelmsford page. Now I can do this by adding the Canonical Path in the pages peramaters on latest 5.7 version. But I have 2000 sub pages which all react from 1 page default all set-up. I dont wish to do this on every page, So i have been tryign to add it direct into the htaccess ? Is their another way? Or can some one help me with y this doesnt work...

RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule    /(.*) essex/$1    [L]


Thanks
C

carl101lee
 
surfsupjoe125 replied on at Permalink Reply
surfsupjoe125
Hi Carl,

I know this may sound too simple but have you tried going to the page and using the attributes and exclude it??

Not sure I am totally understanding your question.

Cheers
carl101lee replied on at Permalink Reply
carl101lee
Good Day..

No that will not work, the page attribute will hide it from the auto nav, Not the address bar (URL). As stated I can do it manually on each sub page, by adding the canonical path, to exclude it. But because I have 3000 Sub pages, this would not be a fun job. Their Must be some sort of script, or maybe in the the page defaults.

I Know this can be done By .htaceess Mod_rewrite, But All the codes I try don't seem to work.
This is for SEO Purposes, So the ability to turn this on and off would be useful.

Thanks for any advise.
C
ob7dev replied on at Permalink Reply
ob7dev
mod_rewrite syntax can be tricky sometimes, but it should work, just need to read about it from the apache documentation until it works right. You may need to change the original mod_rewrite rules provided by c5 when enabling "remove index.php from urls" to cater for your need. Try getting the syntax right on a fresh .htaccess file until it works, then figure out how to make it work with the config provided by c5.