Jump to content

mod_rewrite help


goocharlton

Recommended Posts

I have a website that I am trying to get URL rewriting working on it. This scenario is as follows:

 

The URL in the browser shows .../page/1 and is interpreted by mod_rewrite as .../handler.php?page=1 with the following .htaccess file:

Options +FollowSymLinks
RewriteEngine on
RewriteRule page/([0-9]+)$ /handler.php?$page=$1

 

I try using the PHP GET function to call the page number. I tried using the following code but it just returned blank:

<?php
$page = $_GET['page'];
echo $page;
?>

 

What am i doing wrong?

Link to comment
https://forums.phpfreaks.com/topic/126697-mod_rewrite-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.