Mod_rewrite question

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
Jimmy_Jazz
Posts: 23
Joined: Thu 28. Oct 2004, 13:04
Location: London

Mod_rewrite question

Post by Jimmy_Jazz »

Hi

I was wondering if the mod rewrite function for phpwcms could be made to include the pathway of where you are in the site - like a breadcrumb - for example at the moment however deep you are in the site the url is always written like this

http://www.mysite.com/photography.phtml

This is great but is it posible to include the hierarchy of the site in the url - ie if the section 'photography'' is a child of the section 'Portfolio' it would be written like this:

http://www.domain.com/portfolio/photography.phtml

I noticed that in previous versions of wcms you could use '/' in an alias and thus produce this effect (as long as you had a base href link in the template) . This is no longer possible in the current DEV release.

Some may say this is not really neccessary but I think it looks more professional.

Cheers
Pappnase

Post by Pappnase »

hello

you're not the first who ask for that :wink:

and as far as i know this is not possible!
User avatar
pico
Posts: 2595
Joined: Wed 28. Jul 2004, 18:04
Location: Frankfurt/M Germany
Contact:

Post by pico »

Hi

it's complicated because the real Address to the Content is not in a Path like Portfolio - wath Rewrite is doing is just a 'tranlation' of the Part

index?id=13,67,0,0,1,0 into a friendly Address like test.phtml

and there is no Path-Information in to 'translate'
Lieber Gott gib mir Geduld - ABER BEEIL DICH
Horst - find me at Musiker-Board
Jimmy_Jazz
Posts: 23
Joined: Thu 28. Oct 2004, 13:04
Location: London

Post by Jimmy_Jazz »

Ok I think I understand. Thats a shame though. How do other cms do it?

You could work around it in the previous version of wcms by using a '/' in the alias and a base href in the template. This is not possible any more with 1.2 1 - it converts the '/' into a '_'
Pappnase

Post by Pappnase »

hello

sorry i've never seen this!
Jimmy_Jazz
Posts: 23
Joined: Thu 28. Oct 2004, 13:04
Location: London

Post by Jimmy_Jazz »

Hi Pappnase

You would enter the alias as such:

Image

make sure the header of the template has this html code:

Code: Select all

<base href="http://www.wallcreative.com/">
the see here:

http://wallcreative.com/portfolio/thisi ... test.phtml


That was my work around the problem anyway.
But now in the DEV version it doesnt let you.
jonmayes
Posts: 4
Joined: Wed 13. Jul 2005, 21:32
Location: UK
Contact:

fixed yet?

Post by jonmayes »

how about putting the following rule in your .htaccess file above your default page rewriting rules:

RewriteRule portfolio/(.*)$ $1 [PT]

This would rewrite portfolio/page.phtml to page.phtml and then to index.php?page, but to the user it'd appear as http://example.com/portfolio/page.phtml.

You'd need one such entry in htaccess for each directory you want to do this with though.

HTH
Post Reply