Friendly URL with parameters in HTACCESS

0

I am passing the whole old site to friendly url and with that came various problems on the old site url was this way

link

and with the new url wanted to stay that way

link

I joined HTACCESS and created these rules

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^/download/([a-z0-9-]+)/([0-9]+)/?$ /download/programa.php?title=$1 [NC]

Then when you access link for the server I am going to the link

and in the program page I check if what is coming in the variable title is equal to some title of the database

So that's how the url does not work, I do not know if it's because I did something wrong or if it can not do it this way by visiting link of the error Not Found

Not Found

The requested URL / download / avast-free-antivirus was not found on this server.

Apache / 2.4.23 (Win64) PHP / 5.6.25 Server at mega Port 80

says the page was not found

    
asked by anonymous 15.04.2017 / 20:34

1 answer

0

You did this:

RewriteRule ^/download/([a-z0-9-]+)/([0-9]+)/?$ /download/programa.php?title=$1 [NC]

But for what seems to want the correct is this (and remove the / from the front of both download/ ):

RewriteRule ^download/([a-z0-9-]+)/?$ download/programa.php?title=$1 [NC]
    
15.04.2017 / 20:42