Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & phranque

Message Too Old, No Replies

PHP and mod_rewrite problem!



10:50 am on Dec 28, 2002 (gmt 0)

Junior Member

10+ Year Member

joined:Oct 13, 2001
votes: 0

I'm a newbie with these "hi-tech" issues, so bear with me;)

I've succeeded in creating a mySQL product database and some dynamic pages that get their info from the d-base. Now the last step to take is to change the dynamic urls to static with a .htaccess/mod_rewrite file.

The dynamic urls look something like this: mydomain.com/titles/title.php?id=9007 . The pages look fine, when called this way.

Then I create this .htaccess file:
RewriteEngine On
RewriteRule ^(.*).*/(.*)/$ title.php?path=$1/$2

When I use this mod_rewrite rule, I only see a blank page with the footer, which by the way is called with a PHP include command. Rest of the PHP stuff cannot be seen at all.

Why does the page behave differently, when mod_rewrite is being used? I'm completely lost! All help is greatly appreciated!

8:42 am on Dec 30, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:July 22, 2002
votes: 0

Your RewriteRule will not produce an URI similar to your dynamic URIs. There are a lot of examples of what you want to do to be found on WebmasterWorld and other resources. Have a look at
Introduction to mod_rewrite [webmasterworld.com]
Apache mod_rewrite documentation [httpd.apache.org]
WebmasterWorld Site Search tool [searchengineworld.com]