I'm working on a website on my local machine using PHP.
In my .htaccess file, I have the following line:
RewriteRule ^project-details/([a-zA-Z0-9-]+)/ project-details.php?pn=$1 [NC,L]
On the products page, I have the items containing a link like ./product-details/icecap-mouse249/
...which the .htaccess file would in turn take and assign "icecap-mouse249" to the "pn" found at the end of the line: ?pn=$1 [NC,L]
.
When one clicks on the item, the person is then taken to the product details page. In that page, I have the following line:
$pn = $_GET['pn'];
This allows the URI to pull the 'pn' value and assign it to the variable $pn
and utilize the variable to pull data from a database and display all the information of that particular product.
So, it works locally on my machine, but when I upload the files the page doesn't pull anything with $_GET[pn]
.
The product details page works because when I hardcode the value to $pn
as in:
$pn = 'icecap-mouse249';
the page displays properly...pulling the data from the db.
I've done a phpinfo();
to see if the mod_rewrite is enabled, but the "Loaded Modules" section of the phpinfo page doesn't display. I did a CTRL+F to see if I could find the 'mod_rewrite' through the FIND tool, but nothing pops up.
The thing that trips me up is that it works locally on my machine.
I spent an hour with my host provider...and they weren't any help.
I hope I explained myself right and any insight would be greatly appreciated. Thank you.