Rewriting url / regex debugging

I need a lot of fresh eyes. I find it difficult to find a problem.

In the X folder, I have a .htaccess file with the following two lines:

RewriteEngine on
RewriteRule ^([A-Za-z0-9\.-]+)/?$ item-display.php?bibid=$1 [NC,L]

My interpretation is that anything in this directory will then be redirected to the item display page. The problem is that on the page with the display of elements, repeating the value of the outputs bibid "display-item". So for some reason, I redirect from: http: // localhost / test / cat / item / 14056a to: http: //localhost/test/cat/item/item-display.php? Bibid = item-display

Any ideas?

Greetings

+3
source share
3

, , :

RewriteCond %{REQUEST_URI} !/item-display\.php$
RewriteRule ^([A-Za-z0-9\.-]+)/?$ item-display.php?bibid=$1 [L]
+5

RewriteEngine on
RewritePath /test/cat/item
RewriteRule ^([A-Za-z0-9\.-]+)/?$ item-display.php?bibid=$1 [L]

, , URL, .

+1

The request is being processed, so it extracts part of the name of the rewritten file name that I assume. Try adding the NS flag.

+1
source

Source: https://habr.com/ru/post/1706461/


All Articles