0

I'm trying to build a website upon different $_GET params.

I have

http://localhost/hundesiden/hunde/?race=labrador

I would like to be

http://localhost/hundesiden/hunde/labrador 

and

http://localhost/hundesiden/hunde/?race=labrador&tilbehor=hundebur

to be

http://localhost/hundesiden/hunde/labrador/hundebur

I've tried different things in .htaccess - but can't accomblish what I want, can you help?

My .htaccess is this (doesn't work):

RewriteEngine On
RewriteBase /

RewriteRule ^hundesiden/hunde/([^/.]+)/?$ hundesiden/hunde/index.php?race=$1 [L,QSA,NC]
Niller
  • 1
  • 2
  • What do you mean exactly by "doesn't work"? Do you get an error? Incorrect response? Nothing? The directive you posted should work for your first example (assuming `index.php` is the file that handles the request). Are `.htaccess` files enabled? etc. – MrWhite Feb 15 '20 at 15:54
  • Hi. Yea, nothing. The parameters just still shows up. It seems like .htaccess is enabled. I get an error 500 if I just enters garbage in it :) – Niller Feb 15 '20 at 21:27
  • Look at the server's [error.log](https://httpd.apache.org/docs/1.3/logs.html) file to see what is broken. – Al.G. Feb 15 '20 at 21:31
  • 1
    "The parameters just still shows up." - ? What URL are you requesting? You should be requesting `/hundesiden/hunde/labrador` (no parameters) - that is what your directive is expecting. – MrWhite Feb 15 '20 at 22:02
  • If i request /hundesiden/hunde/labrador i get this 404 https://www.screencast.com/t/qVJq1XZXM – Niller Feb 16 '20 at 11:53

0 Answers0