Forum Moderators: phranque

Message Too Old, No Replies

Pages mod rewrited doesn't load

It is 90% the same script,but on other server - i'm newbie

         

rowtc2

10:24 pm on Jul 26, 2008 (gmt 0)

10+ Year Member



I have uploaded my main PHP script on other server and i am trying to put online a website.
I have some products in mysql ,everyone with an unique id number and pages from root have htm extensions
I want to rewrite the product.htm page from the root in www.mysite.com/id.htm to have all dinamic pages rewrited with id's.

I am using the following code,but page is loading only with static html content(not loading php dinamic informations from database).
My webhosting has confirmed htacces is enabled and is working fine in Apache.
My index homepage is loading normally with informations from database.
I am missing something ?


Options +FollowSymlinks
RewriteEngine on

RewriteRule ^(.*).htm product.htm?doc_id=$1

# -FrontPage-

IndexIgnore .htaccess */.?* *~ *# */HEADER* */README* */_vti*
AddType application/x-httpd-php .html .htm
<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>

jdMorgan

11:08 pm on Jul 26, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There is nothing in that rule to prevent it from rewriting /product.htm?doc_id=<anything> to /product.htm?doc_id=product -- In other words, it rewrites your script pathname to itself. Try:

RewriteCond $1 !^product$
RewriteRule ^(.*)\.htm$ product.htm?doc_id=$1 [L]

That should produce more satisfactory results... :)

Jim