rewrite url and redirect to extended page in silverstripe

301 views Asked by At

I'm kinda a beginner in Silverstripe and I want specific urls to be redirected to custom page that extends the class page.

I added the rule in my .htaccess file:

RewriteEngine On
RewriteRule ^.*-i(\d+)$ inv/test.php [NC,QSA]

which detect my urls successfully and redirect to test.php

I have a custom page class that extends the class page, I want somehow to load an instance of my custom class page.

Edited: I have many urls that have specifc formats, something like: www.mysite.com/segment1-segment2-segment3-i543 where that last number is the id of the item,but all these urls are not pages in the cms. My rule in the .htaccess detect these type of urls. I want to render these pages using my template for this custom class.

0

There are 0 answers