pages with addiotional url like /pages/test/xxx/yyy

fred66

Member
Hey at all,
is there a way to generate dynamic urls in pages.
when i create a page via php callback i cant use dynamic url?

my page name is: test
url to the page is: pages/test/

is there an option to add after "pages/test" more parameters without creating another pages site?

i want generate like
pages/test/site.01/
pages/test/site.02/

in my PHP callback i take then the last url parameter and load other content.
or is there an option to load only the header and footer in an .php file?
 
Hope this is useful for what you're asking...

Generally for custom URLs I create rewrite translations in .htaccess. So pages/test/site.01/ might be:

RewriteRule ^pages/([a-z0-9\]+)/([a-z0-9\]+)\.([0-9]+)/?$ index.php?page=$1&content=$2&contentid=$3 [NC]

That passes 3 URL parameters to your index for page (test), content (site) and content ID (01) which you can then use to load relevant classes and content within your application.

Depending on how your site is structured, each component in the URL can define what modules are loaded, so even the first "pages" could be dynamic regex to load other components of your site. The first parameter on my site always determines what the base module is, with each subsequent parameter separate by the slashes determining parameters within that core module.
 
Any solution for this? I want to do exactly the same thing and I've been looking for an answer for over 1 month :(

I thought about using a solution similar to what @dknife suggested, but the problem is that even if I set up a htaccess rewrite rule, index.php will redirect to /pages/test/ if the friendly URL's are enabled.

So as a workaround, I am not trying to figure out if there is a way to disable friendly URL's only for a specific page node (maybe I can call some function in my PHP callback to disable the friendly URL for this page node?)
 
Top Bottom