Mod Rewrite Generator
Create the rewrite rules for your htaccess file.
This tool allows you to generate custom error pages for your website, helping you provide a more user-friendly experience when visitors encounter an issue. Custom error pages can be used to display helpful messages for common errors such as 404 Not Found, 403 Forbidden, or 500 Internal Server Error, instead of showing a generic server message.
To get started, simply enter the location of your custom error pages into the fields below and click “Generate It.” Be sure that each path begins with a leading slash (/), as this tells the server where the error page is located relative to your website’s root directory.
Once generated, copy and paste the resulting code directly into your .htaccess file to activate the custom error handling on your site.
Important: If an incorrect or invalid path is entered, it may trigger a 500 Internal Server Error, which can prevent your website from loading correctly. Always double-check your file paths and test your configuration after making changes.
Everything is built in your browser and nothing is sent anywhere. Only error codes 400 and above are listed, because that is what an error page can be set for. Upload your error pages before you add the code.
The error page generator makes it simple to create the necessary code for error pages that you copy in to your htaccess file.
Use a path such as /404.html. A path without the leading slash is not understood by the server.
If the file is missing or the path is wrong, visitors may see a 500 error. Test after every change.
A full web address makes the server redirect the visitor, so search engines see a 302 and not the real error.
On Apache, add the lines to the .htaccess file in the root folder of your website. Make a backup copy first. On Nginx, the lines go inside the server block of your site configuration, and Nginx must be reloaded.
Most often the path is wrong, the page does not exist, or .htaccess contains a typo. Remove the new lines, then check each path against the real location of the file.
They are redirects, not errors, and an error page cannot be set for them. To redirect a page, use Redirect or RewriteRule, which our Mod Rewrite Generator can write for you.
No, it can be any file on your site, such as a .php page. The visitor still receives the correct error code, as long as the path starts with a slash.
Visit an address that does not exist, for example a made-up page, and see if your page appears. Then use the HTTP Header Viewer to confirm the status is still 404 and not 200 or 302.
No. The code is made in your browser and the paths you type never leave your device.
Create the rewrite rules for your htaccess file.
View the headers of the site of your choice, exactly what your browser reads.
Seamlessly analyze and track the complete path of URL redirects.