RewriteRule Generator for Apache .htaccess


I hope this tool will help you.

Generate - UnGenerate Apache .htaccess RewriteRule

- generate permanent 'RewriteRule' lines for an Apache .htaccess file.
- un-generate 'RewriteRule' lines into the original lines used to create them.

The lines format must be old-url comma new-url.
The 'www.' in the old URL is optional.

URLs trailing / are optionals.
(Using a / at the end of an URL is faster, as it avoids a second HTTP request to the server.)

UnGenerate uses the domain on the same line, pay attention with different domains!

Do not forget to add 'Rewrite on' before the generated lines in the .htaccess file.
Before each domain add a new 'RewriteCond' before each corresponding 'RewriteRule' lines block.
More information about Apache .htaccess file.

Field 1 - old-url,new-url lines

Put old-url,new-url lines in Field 1 then click Generate.

Field 2 - RewriteRule lines

Put RewriteRule lines in Field 2 then click UnGenerate.


Field 1

Field 2
RewriteRule ^blue\/?$ "http\:\/\/www\.mysite\.com\/red" [R=301,L]
RewriteRule ^en\/cyan\/?$ "http\:\/\/www\.mysite\.com\/en\-uk\/cyan" [R=301,L]
RewriteRule ^pict\/img\_01\.jpg\/?$ "http\:\/\/www\.mysite\.com\/pict\/new\_door\.png" [R=301,L]
RewriteRule ^hello\.html\/?$ "http\:\/\/www\.mysite\.com\/welcome\.php" [R=301,L]
RewriteRule ^page01\/?$ "http\:\/\/www\.mysite\.com\/red\-shirts" [R=301,L]

Problems and suggestions are welcome.

Soon... delete duplicates, group lines by domain, sort...

Copyright © 2009-2017 - Tous droits réservés - Informations légales - Sitemap