Forum Moderators: phranque

Message Too Old, No Replies

?page=page1 to page1.php

dynamic to static

         

varunkrish

8:02 pm on Jun 10, 2005 (gmt 0)

10+ Year Member



i want to redirect
site.com?page=page1 to page1.php

i tried this

RewriteRule ^?page=page1$ page1.php

Not working

thanks in advance

jdMorgan

4:29 am on Jun 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This thread [webmasterworld.com] may be helpful.

Jim

varunkrish

9:19 am on Jun 12, 2005 (gmt 0)

10+ Year Member



please help me ...tats not working

i tried this one

RewriteRule ^index.php?page=page1$ /page1.php[R=301]

jd01

9:51 am on Jun 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Varun,

I think, either your question was unclear, or you missed the importance of the other thread. The only way a query string is seen is in a condition. To prevent looping, when returning a page you would like to still serve information from to a different (in this case static) URL you will need to use %{THE_REQUEST}. If you are only trying to redirect a URL with a query string, but will no longer need to access the page to server information, you still must use a condition, but can use %{QUERY_STRING} instead.

See the thread Jim highlighted for %{THE_REQUEST} or this one [webmasterworld.com] for %{QUERY_STRING}

Justin

varunkrish

6:20 am on Jun 13, 2005 (gmt 0)

10+ Year Member



Hi Justin,
yes i did not understand how to use the query string in a rewrite rule..

this post is in my direction i think..

please help me on how tosearch the forum.. as i tend to start threads which already exist in a older thread

thanks

varun

jd01

8:38 pm on Jun 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi varunkrish,

The easiest way to search the forums, is to use a major Search Engine, and the key word(s) you would like to find with the site: command, like this:

keyword or phrase site:webmasterworld.com

EG
query_string site:webmasterworld.com

Justin

BTW Don't feel bad, most of the threads started have been answered at some point in time, with different specifics, finding and implementing the correct solution is not always as easy as it seems it should be though =).