Mod_rewrite: December 2006 Archives

2006 Dec 7

we could redirect our users from a 404 error page not found to any url by editing our .htaccess files. this is usefull to give us more control in handling vairous html error codes. using the ErrorDocument tag and specifying the error code 404 as the page not found error code, (other error code might also be used in the redirect like: 400 - Bad Syntax, 401 - Unauthorized, 402 - Not used, 403 - Forbidden, 404 - Not Found, 500 - Internal Error, 501 - Not Implemented, 502 - Overloaded, 503 - Gateway Timeout).

Redirecting to an error page:

ErrorDocument 404 /404.html
- redirects the user to the 404.html page

using Rewrite to do the redirect:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.+) http://www.tildemark.com/404page/$1

or

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)testing\.html?$ temporary/$1

Display an html page:

ErrorDocument 404 <b>Page Not Found</b><p /><br /><a href="http://www.tildemark.com">Tildemark blogs homepage</a>

About this Archive

This page is a archive of entries in the Mod_rewrite category from December 2006.

Mod_rewrite: September 2006 is the previous archive.

Mod_rewrite: April 2007 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Recent Activity

Friday

  • tildemark tweeted, "im so sleepy. Zzzzzzzz"

Sunday

  • tildemark tweeted, "some of my scipts are not working with godaddy. but works fine on the others. not mention their poorly coded admin page"

Today

  • tildemark tweeted, "so many pending tasks i need to finish. need more coffee !!!"
  • tildemark tweeted, "@gmtristan i dont think that is true."

Today

  • tildemark tweeted, "how does godaddy subdomain behaves? i have some problems with it on my scripts. it does not seem to accept query strings.."

Monday

  • tildemark tweeted, "i had a hard time removing the error messages generated by surf side kick. i ended up uninstalling most of my applications."

Sunday

  • tildemark tweeted, "i got hit by surf side kick and im getting numerous error messages on my screen. tskkkkk"

Saturday

  • tildemark tweeted, "check boxes, i didn't know they can also be complex"
  • tildemark tweeted, "this smart bro internet speed is depressing, i thinking of filling a complaint to the DTI next week."

Friday

  • tildemark tweeted, "the seminar turned out to be leadership training. it was fun, learned alot. i have already attended numerous seminars but this is different."