I am attempting to implement a simple Apache mod rewrite and am having an issue with it. The pattern I am providing does not seem to be matching,although from what I can tell it should.
I am placing these rules in my .htaccess file. Here is the file in it’s entirety:
RewriteEngine on
RewriteRule ^détails-details-eng.php/([\d]+)/*([\w'-]*)$ détails-details-eng.php?id=$1 [L]
# done for testing
RewriteRule ^mytest/?$ index.php [NC,L]
The functionality I am looking for is, coincidentally similar to how stackoverflow’s urls look. When I browse to
détails-details-eng.php/1/somtext
I go the détails-details-eng.php page but the id of 1 is not being passed(a quick print_r($_GET) confirms). I know mod_rewrite is enabled because going to :
mytest
resolves to index.php as it should.
Could anyone tell me what I am doing wrong here? When I check my regular expression via RegExr
it seems to be what I am looking for. Any help is very much appreciated. Thanks!
Here is the rule that you will need: