Skip to main content

Posts

Showing posts with the label mod_rewrite

Working with Apache mod_rewrite module

Introduction This is a guide to the Apache mod_rewrite module. This is a module included with the Apache web-server which provides the ability to manipulate URLs prior to determining the appropriate file or handing off to a script. This is commonly used when a visitor goes to a certain web address, but the server returns a different document to the one implied by the page address. If you've ever wanted to be able to offer different URL's for the same file, or even direct to a different website all together then mod_rewrite can help. It offers more functionality than the mod_alias module which can be used to perform some basic mapping between URL's and filenames. Documentation is available with the module, but it can be difficult to understand at first. This guide for mod_rewrite provides some simple examples to get an idea of what can be achieved. Some of the examples shown here could be performed using the simpler mod_alias, but understanding mod_rewrite will ...