The Mod Rewrite Generator can be used to turn dynamic URLs
into search engine friendly static URLs. Static URLs
typically rank better in search engines than long complex
dynamic URLs with lots of parameters, they are easier to
index in the first place and they're also friendlier looking
to the end user.
The apache module mod_rewrite converts urls in a certain
format to another format, and can be very useful in helping
a site with dynamic content to be indexed.
Using this tool you can transform long dynamic URLs into short static URLs.
Enter your dynamic URL and click Rewrite URL to generate your new URL:
For example, you may enter the URL:
http://www.domain.com/cgi-bin/shop.php?cmd=product&category=vehicles&product=bus
and transform it into
http://www.domain.com/shop/vehicles/bus.html
On this page, the wizard will help you make your URL perfect.
Look! The wizard has suggested you a rewritten URL already.
The original URL
The rewritten URL
If you are satisfied with the rewritten URL, click
Otherwise, customize it to fulfill your needs.
Configure the Wizard to get a better URL. The rewritten URL is updated as you change the settings.
Select parameters that should be present in the rewritten URL. By default, only the values of parameters are included. You may add both the name and value to the rewritten URL or remove a parameter completely.
parameter-name |
---|
Parameter | Value | Name & Value | None |
---|
Tips and hints
- Do not include names of the parameters since this will complicate the rewritten URL. Include a name only if it is a keyword.
- Include all the values. If you want to take away a value, first make sure that the value is constant for each original URL covered by the generated rule. Otherwise, we do not recommend to take it away.
It is a tool for improving the form of the rewritten URL and increasing its relevancy.
Enter the prefix:
Tips and hints
- Include an additional keyword.
- Differenciate rewrite rules. If you have several rewrite rules for one site, you need to distinguish them. The prefix is a convenient tool for this purpose.
Select the delimiters according to your taste.
Select the delimiter: / slash – dash _ underscore
Tips and hints
- Do not use the delimiters that appear in the values of the parameters.
- Do not use many slashes as it will decrease the relevancy of the URL.
- Dash is better than underscore for separating keywords.
You may use the suffix to make the extension conform to the rest of your site. You can also include one or more keywords.
Select the suffix: .html .php
Tips and hints
- Keep .html if not sure.
- Include a keyword before the extension.
Congratulations! You have made a new rewrite rule.
Please pay attention to the parts marked by different colors. They are values of the parameters. The rewrite rule covers URLs that has the same form, but different colored parts. If you change a part of the rewritten URL, the corresponding part of the same color of the original URL is changed too.
The original URL:
The rewritten URL:
You may check if another URL will be rewritten by this rule and get the corresponding rewritten URL. Using this tool, you may easily get rewritten URLs for your original URLs.
You may also get the original URL by the rewritten URL. This tool converts URLs in both directions.
Original URL:
No corresponding Rewritten URL found!
Rewritten URL:
No corresponding Original URL found!
Rewrite Rule
Rule for .htaccess
The mod_rewrite rule for your site is done. Please follow the instructions below to install it.
- First you need to check if the file .htaccess exists in the root of your website.
- If the file .htaccess exists, download it from your site, add the lines below to the end of the file, and upload the modified file back to your site. Please make a copy of the original file .htaccess. So if anything goes wrong, you may restore the original file.
- If the file .htaccess does not exist, create a new file .htaccess and add the lines below to it. Then upload it to the root of your website. You may delete it if anything goes wrong.
Add the following lines to .htaccess: