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