Jump to content

Rewrite problem htaccess


nemonline

Recommended Posts

Hi there,

 

The following code works just fine on a production server, but when i try it on a test server with same configuration, it fails.

Prod server: PHP Version 5.3.2-1ubuntu4.5

Test server: PHP Version 5.3.2-1ubuntu4.17

 

Core directives are identical on both servers, since i copied the php.ini file from the Prod. server.

 

 

<?
if (!isset($_GET['id'])){$id = '0';}else{$id = $_GET['id'];} echo"$id <br><br><br>";

if($id=='' or $id=='0'){echo"This is a test page with A SINGLE VAR for htaccess<br><br><a href=\"/test/2.html\">Click for 2 VAR page</a>";}else{echo"$id | This is a test page with 2 VARs for htaccess";}

?>

 

The Prod server gives me 2.html the message "This is a test page with 2 VARs for htaccess" when i click the link.

The Test server gives me 2.html with the "This is a test page with A SINGLE VAR for htaccess" message when i click the link.

 

What should i look for? The apache2/error.log is clean.

 

Here is .htaccess:

Options +FollowSymLinks
RewriteEngine On

php_flag display_startup_errors on
php_flag display_errors on
php_flag html_errors on
php_value docref_root 0
php_value docref_ext 0

RewriteRule ^(test)/([^/]*)\.html$ /index.php?link=test [L]
RewriteRule ^(test)\.html$ /index.php?link=test [L]

Link to comment
https://forums.phpfreaks.com/topic/266209-rewrite-problem-htaccess/
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.