0

I'd like to have url like

mydomain/a/b from mydomain/page.php?a=$1&b=$2

The htaccess file understand that I want to go to mydomain/page.php?a=$1&b=$2 when i use mydomain/a/b but he change the urlname to mydomain/page.php?a=$1&b=$2 and I don't want that, i want to keep mydomain/a/b.

Here is the htaccess file I use:

RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)/([0-9]+)$ page.php?a=$1&b=$2
Cœur
  • 37,241
  • 25
  • 195
  • 267
  • `a/b` isn't a real directory – Jérôme Weber May 22 '15 at 07:42
  • Here is what i got `/test/1 Request URL: mydomain/test/1 Request Method:GET Status Code:302 Found Location:mydomain/page.php?a=test&b=1` and `mydomain/page.php?a=test&b=1 Request URL:mydomain/page.php?a=test&b=1 Request Method:GET Status Code:200 OK` – Jérôme Weber May 22 '15 at 07:58
  • I don't want to redirect, i just want to rewrite my url, it doesn't work and i don't know why. It's like something rewrite the pretty url to make him like `mydomain/page.php?a=test&b=1 ` – Jérôme Weber May 22 '15 at 08:28
  • I find my solution. I was using http// on htaccess and it force redirecting the page. That's why the url change. But he doesn't find my page without it because i was using alias on my apache serv. So i needed to add Rewrite Base /v152/... to my htaccess and now it's work! – Jérôme Weber May 22 '15 at 09:34

0 Answers0