Forum Moderators: phranque

Message Too Old, No Replies

Program to test RewriteRules

         

superjacent

6:17 am on May 13, 2008 (gmt 0)

10+ Year Member



Title says it all. Is there a program or site out there where RewriteRules can be tested.

SteveWh

9:49 am on May 13, 2008 (gmt 0)

10+ Year Member



I don't know of a program or site, but you can create your own "test environment" on your own server.

To whatever your other rewrite conditions are, add this one, changing the numbers to your own IP address:

RewriteCond %{REMOTE_ADDR} ^111\.222\.333\.444$ [NC]

It tests the IP of the requestor. If it's YOU, it does the rewrite you're testing. If it's anyone else, it doesn't, so you can test it on yourself before it affects anyone else.

boxfan

2:01 pm on May 13, 2008 (gmt 0)

10+ Year Member



If you screw the rewrite up, won't everyone still get a 500 error?

jdMorgan

2:28 pm on May 13, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Everyone will get a server error if you have a syntax error in your new code. If the code's syntax is correct but the function is incorrectly-implemented, then (assuming you've added the IP address test suggested by SteveWh) only you will see the server error.

Suggestions:

  • Set up a test server on an old PC -- Apache is free.
  • Set up a test subdomain on your hosted server. Remember to block search engines so they can't index it!
  • Set up a test subdirectory on your hosted server. This is a last resort, since it can add complication to the code being tested.

    I prefer the first two options. The second option is only 'easy' to do if you have a unique IP address for your Web site. Otherwise, it can get a bit complicated, or it may not be possible; It depends on your host and your "control panel."

    Jim

  • superjacent

    5:05 am on May 14, 2008 (gmt 0)

    10+ Year Member



    Thanks all.