I've been trying to figure this problem out for a while now but I don't seem to be getting anywhere.
Basically I have a Wordpress site which only allows certain levels of permalinks - using pretty URLs - but I want to be able to mod_rewrite it so I can literally put anything I want within in a level but it be removed by the htaccess.
For example:
- Code: Select all
http://mywordpresssite.com/page/keyword/id/
The 'keyword' can be anything, something that pertains to that page. However, the 'id' must remain there in order for the page to dynamically display the correct content. So if I write:
- Code: Select all
http://mywordpresssite.com/webhosting/blog-hosting/123
This would actually be interpreted as:
- Code: Select all
http://mywordpresssite.com/webhosting/123
And the 123 would actually display the "blog hosting" page. Hypothetically.
I've currently come up with
- Code: Select all
RewriteCond %{THE_REQUEST} ^[A-Z]{3}\ /webhosting/[A-Za-z0-9]?-(.*)\/(.*)\ .*HTTP [NC]
RewriteRule .* /webhosting/$1 [R,NE,R=301,L]
But, to be honest, I'm really stuck and not quite sure what all of it means! I simply want to be able to grab an id from the URL but remove the "keyword" part of it - I only want the keyword there for SEO purposes.
Thanks in advance - any help is appreciated.
Michael