Question

I would like to rewrite the following URL string from:

product.php?category=abstract_and_patterns&page=1

To:

abstract-and-patterns

Now it's important to note that both the category and page variables will always be different depending on what page the user is on or which category they have selected.

I have spent hours trying to figure this out with no success.

[EDIT]

I've tried a ton of things but the latest rewrite I've tried works but comes up with a 404 error.

RewriteCond %{QUERY_STRING} ^category=([^&]+)&page=([^&]+)$
RewriteRule ^product.php$ /%1/%2? [L,R=301]

[EDIT]

Just so you guys know, there is actually only 1 page, that is the products.php page. The information on that page is pulled from the database based on the values in the query string. Now obviously for both user friendliness and also SEO purposes I need the URLs to be clean rather than category=abstrsct_and_patterns&page=3 but I also need the query strings to be remembered, especially for pages, so that the site still functions. Is this even possible? Thanks.

Was it helpful?

Solution

Turns out that this cannot be achieved the way I wanted it to be.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top