Best practice... you views on this approach

Hi all

I had a previous post in another category http://www.sitepoint.com/forums/showthread.php?1172680-How-do-I-keep-Facebook-likes-after-URL-change

The above went unanswered which brings here.
I have a general rewrite that works ok and have a indexed page.php I need to add extra content to this page page/more-content which for the time being can’t have the extension removed. .php in this case.

What are the concerns and is it ok to have the pages structured like this?

page.php
page/more-content
page/some-more-content
page/some-more-content-content

and so on…

I won’t be rewriting page.php what I mean is I won’t be linking to /page
This is my main worry because I’ll be serving content without the file extension to other pages.

Hope this makes sense, thanks.

cb,

I avoid this sort of thing like the plague but, if you want to pursue it, you’ll need Options +MultiViews which will examine the directories in the path and serve a file despite the extension not being specified. Of course, page.php will have to deal with the $_SERVER[‘REQUEST_URI’] whether it contains/requests any more content.

The downside I’ve seen from members in the past is that they use the same name for a subdirectory as a filename and wonder why the requested file (in the subdirectory) isn’t being served. If you’re better organized than the other members (and me, too!), they you should be okay.

Regards,

DK

I avoid this sort of thing like the plague
Just what I thought DK. This is certainly not the the way to go, can’t seem to find a better alternative unless I create new pages which basically defeats the object. Regarding SEO, DRY anyway and generally the overall content flow. It does make me laugh all the messing about because of a facebook like. (:

I’ll have to reassess the issue, maybe I’ll get a response to my other thread :slight_smile:
Even if it does work I’ll know this approach is wrong, like writing messy code DK its not acceptable and kind of goes against everything I’ve learned.

Thanks for the feedback :cool:

cb,

That was my take on MultiViews … but the simple fact that it exists means that someone must like it. At least I attempted to let you know what to look for if you decide to use it after all.

Regards,

DK

Hi dk

I’ve never used MultiViews before and have no idea where to start. That’s the main reason I excluded this and didn’t give it much praise.
Are you saying this will be ok?
Seems like this will be the only way I can do it. I’ve had to put things on hold regarding new content.

Do you have any good simply resources at hand for the MultiViews or can you explain the best way?

Cheers, cb

cb,

Apache.org is always the best place for Apache information: mod_negotiation’s MultiViews will have the information you are seeking. If it’s available there, I’m sure that someone has a good reason to use it but …

As for me, my STRONG bias is to use Options -MultiViews so I don’t have file/directory naming problems and advise others to avoid it, too.

Regards,

DK