Rob
Rob

Reputation: 11388

Wordpress Catch All URL

I'm trying to get a wordpress page to "run" another page based on the url. So if I have a main page like:

/extensions

That will run the regular extensions page. But if I have urls like:

/extensions/test
/extensions/test/again
/extensions/text/again/etc

They will all just run the extension (no "s") page:

/extension

The extension page will parse the url and do it's thing at that point. I tried setting up a redirect rule in the .htaccess file like so:

RewriteCond %{REQUEST_URI} ^/extensions/.*
RewriteRule . /extension [L]

But I can't seem to get it going. I'm assuming wordpress is always parsing via the index.php file, which is some how trumping my little rewrite possibly. Is there anyway to set this up on wordpress?

Upvotes: 0

Views: 1891

Answers (1)

Rob
Rob

Reputation: 11388

Found the answer here.

Note that this should go into the functions.php file and you will have to hit save in the permalinks settings EVERY time you make a change to the function to see the effects.

Upvotes: 1

Related Questions