I'm trying to rewrite/redirect page.php?kw=x to x.php, but I don't want users to be able to directly access x.php unless they've been redirected there from page.php?kw=x. Thus far I'm up to
- Code: Select all
RewriteRule ^([^/]+).php$ landing.php?kw=$1 [QSA,L]
but the redirect is giving me problems.
I was also wondering if there's a way to strip everything but letters from the variable x, and to replace spaces with hyphens?
Could anyone help please? This is driving me mad