siddparkar siddparkar - 1 month ago 4x
Apache Configuration Question

Make a friendly URL with 2 parameters on PHP with Apache

So I am in a bit of a soup here.

I need to make a friendly URL.

This is the URL where I enter the search values project_name and version


This is where it takes me to on submitting the values


I want the URL in the following form


I tried doing this using .htaccess but not really finding a solution

The following is the code for the .htaccess file.

<IfModule mod_rewrite.c>
#Turn the engine on
RewriteEngine on

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

#RewriteRule ^(.*)/$ download.php?project_name=$1&version=$1
#RewriteRule ^/(.*)$ download.php?version=$1

#RewriteRule ^(.*)/(.*)$ download.php?project_name=$1&version=$2 [L,NC,QSA]
#RewriteRule ^(.*)$ download.php?version=$1


I would be really grateful if someone could help me out with this. This is the first time I am working on something on this and am lost.



Have this .htaccess inside /demo_webpages_project/:

Options -MultiViews
RewriteEngine on
RewriteBase /demo_webpages_project/

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/?$ download.php?project_name=$1&version=$2 [L,QSA]