Fun with mod_rewrite

Apache HOWTOs Web Development

Apache’s mod_rewrite is very powerful. You can prevent hot-linking to your site’s graphics to prevent others from stealing them, redirect your from your old URL to a new URL, re-write URLs, as well as about 500 other really cool things…but today I wanted to share the syntax needed to redirect every incoming URL for a particular web site to a specific page. Why? This could come in handy when doing work on a site and you have a “Performing Updates” (in this case index.html) page. You can put the following code in your .htaccess or httpd.conf file:

# Enable rewrite engine
Options +FollowSymLinks
RewriteEngine On

# Redirect internally all URLs to /index.html
RewriteRule .* index.html [L]

Leave a Reply

Your email address will not be published.
*
*

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Life

For the Person Who Has Everything

If you have a hard to buy for person in your family or circle of friends…and they have a good sense of humor, check out the custom bobbleheads. One of my friends had one made for him and it is unbelievable how much they look alike! Enjoy!

Life

Customer Service

I have always found myself sticking with companys that offered really great customer service. Personally, I would prefer to pay more to get good customer service than to pay less and get frustrated every time something goes wrong. On that note, I love Land Rover. Not only does the company make amazing cars, they treat […]