rewriting url

Sc0uT

Verified User
Joined
Feb 14, 2006
Messages
28
Location
Bosnia and Herzegovina
Hi,

On my earlier two servers with other control panels (CPanel and ISPConfig) I used simple mod_rewrite rule in .htaccess to simplify URLs on my site:


RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteRule ^page/(.*)$ page.php?ime=$1

But on a new server with DirectAdmin it won't work.
I checked, mod_rewrite is loaded in apache (1.3.34). DA is latest version...


Any ideas how to enable this?
 
I've found that php variables are not passed to the script, when mod_rewrite is used this way, so I edited my page.php:

Code:
<?php

if (isset($_GET['ime'])):

-- here goes my MySQL query --

else:

$something = $REQUEST_URI;

#removes "/page/" from "$something"
$ime = substr ($something, 6);


-- and here goes my MySQL query again --

endif;

?>

It isn't server wide solution, or a nicest one, but at least I didn't have to fix half of links on my site...

Still looking for server wide solution, could it be some setting in php.ini?
 
Back
Top