Infinite loop

New to mod_rewrite? This is a good place to start.

Infinite loop

Postby BMN » Wed Dec 01, 2010 10:39 pm

Please help!
I'm trying to learn mod rewrite & short urls

Old adress = index.php?id=cakes
new one trying to create cakes.htm

BUT! : when there are links for index.php?id=cakes I want them to say 301 and CHANGE the address to cakes.htm but cakes.htm should still get the data from index.php?id=cakes

So this gives infinite loop:

Code: Select all
RewriteRule ^([a-zA-Z0-9-_]+).htm$ index.php?id=$1 [L]

Code: Select all
RewriteCond %{QUERY_STRING} id=(.*)
RewriteRule ^index.php?(.*) %1.htm? [L,R=301,NC]

I have multiple pages, so this should be dynamic.

I would also like to know how to make the "enter page" to have some name

index.php + index.php? --> myintroduction.htm
(this can be static) but i can't this to work so that it does not catch all addresses
Posts: 39
Joined: Wed Jul 05, 2006 2:15 am

Return to Beginner's Corner

Who is online

Users browsing this forum: Google [Bot] and 1 guest