I currently have the following code to rewrite a friendly search URL to what PHP can handle, but there are a few problems.
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*)/(.*) index.php?$1/$2
It overwrites domain.com/cat/mens/size/large/in domain.com/index.php?cat/mens/size/large/.
It would be ideal if I could rewrite it to something like this, using various numbers of helper directories, such as this, more PHP-friendly:
Perfect record: domain.com/index.php?cat=mens&size=large
Another example: domain.com/page/value/subpage/subvalue/something/true/
Rewrite to: domain.com/index.php?page=value&subpage=subvalue&something=true
There is also a way to rewrite: domain.com/search/?q=blah+blah
To: domain.com/index.php?search&q=blah+blah
source
share