0

So I have my framework that handle all URLs via one index.php page. If I put site.com/profile/user it will go to site.com/index.php?url=profile&next=user and parameter "url" loads different pages for example /home would be index.php?url=home

Problem now is that I wont to expand my rewrite rules in htaccess file so I have one more additional parameter which would be for example site.com/profile/user/auctions and it would look like site.com/index.php?url=profile&next=user&category=auctions.

My rewrite rules are listed below:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^]+)/([^/]+)(/([^/]+))?$ index.php?url=$1&next=$2

So problem is I can't put additional "category" parameter which would be index.php?url=$1&next=$2&category=$3 , whenever I change rules one parameter works but other dont.

Thank you for reading, and I hope it could be solved.

tereško
  • 58,060
  • 25
  • 98
  • 150

1 Answers1

0

Try this one:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]*)/([^/]*)/([^/]*)$ /index.php?url=$1&next=$2&category=$3 [L]

I take this rule from my own .htaccess file and just rename variables, so it must work. If the reason just in this file of course

raskalbass
  • 740
  • 4
  • 21