Experimental: new option to allow slashes in alias

Discuss phpwcms here, please do not post support requests, bug reports, or feature requests! Non-phpwcms questions, discussion goes in General Chat!
Post Reply
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Experimental: new option to allow slashes in alias

Post by flip-flop »

... In combination with URL Rewrite you can fake segmented URLs.

Please have a look and test : http://code.google.com/p/phpwcms/source/detail?r=440
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
User avatar
Jensensen
Posts: 3000
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Re: Experimental: new option to allow slashes in alias

Post by Jensensen »

How, what, why, when ???
I still get /page.html instead of /category_1/subcat_32/page.html

and I never used 'slashes in alias' so far.
How do slashes effect rewrite? How to use this new feature?
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
User avatar
Oliver Georgi
Site Admin
Posts: 9907
Joined: Fri 3. Oct 2003, 22:22
Contact:

Re: Experimental: new option to allow slashes in alias

Post by Oliver Georgi »

To enable this feature first you have to set

Code: Select all

$phpwcms['alias_allow_slash'] = 1; // Allow slashes / in ALIAS
in conf.inc.php. Then it is possible to use slashes in the alias. You do not have to enable Rewrite at all – but you know better get rid of the index.php in URL.

At all – still a handjob to name your aliases like "oh/my/gosh/what-a/brilliant/solution"

Then your URL will result in http://example.com/oh/my/gosh/what-a/br ... ution.html (or whatever extension you have set in $phpwcms['rewrite_ext']).

To fix a behavior with relative URLs like local CSS, JavaScript, Images and so on when using segmented URLs the necessary

Code: Select all

<base href="http://example.com">
is injected into the HTML <head>.
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
User avatar
adamderesz
Posts: 19
Joined: Sat 3. Oct 2009, 14:06
Location: Gdansk / Poland
Contact:

Re: Experimental: new option to allow slashes in alias

Post by adamderesz »

I find myself being more phpwcms fan and user/webmaster than 'coder' but from that solution (thumbs up, was looking forward to it patiently for a while)... well from that point, to, what we'd more need - an automatically generated url 'catalogues' path, is a very small step, I guess...

We do keep all site structure info in a table (permanently or update it every time a page is reloaded), right?
(there is a patch in frontend_render that shows strucure 'levels' so we do keep it for sure)

so once we do have a structure each time page refreshes - just pull out the structure aliases one by one, join with "/", put "rewrite-file-suffix" at the end.... et voila

point is that it requires someone that really knows the sys to do it in couple of lines of code - just to put it in a right place
I would struggle months on it, I guess... so I do keep fingers crossed for this feature to become standard, soon.

cheers
Adam
User avatar
adamderesz
Posts: 19
Joined: Sat 3. Oct 2009, 14:06
Location: Gdansk / Poland
Contact:

Re: Experimental: new option to allow slashes in alias

Post by adamderesz »

Must say it out loud. You guys rock! :)
Just found that feature in one of latest releases ^^

best
Adam
Post Reply