Webserver configuration guide
Info
LinkAutocorrect works by intercepting 404 Not Found events, finding matching pages, and then redirecting the user to that page. For this behavior to work, you need to modify your webserver's configuration to redirect 404 events to LinkAutocorrect.
Apache2 and LiteSpeed
Add the following rule to your public HTML Directory:
FallbackResource /linkautocorrect/404handler.php
Important: You might need to add the rule in multiple places if you have more than one public Directory.
Here is an example of how the edited part of your configuration could look like:
#... # Sets the default security model of the Apache2 HTTPD server. It does # not allow access to the root filesystem outside of /usr/share and /var/www. #... <Directory /var/www/> FallbackResource /linkautocorrect/404handler.php Options FollowSymLinks MultiViews AllowOverride None AddDefaultCharset UTF-8 Require all granted </Directory> #<Directory /srv/> #...
Only the mod_dir module is required, but we recommend to also enable mod_rewrite and mod_negotiation.
The following rule can be used alternatively but will result in the Vecdoor automatic captcha system not working. Make sure to disable prot_vecdoor_mode and completely remove Vecdoor from prot_block_behavior if you have to use this rule.
ErrorDocument 404 /linkautocorrect/404handler.php
Nginx
Add the following rule to your public HTML directory:
location / {
try_files $uri $uri/ /linkautocorrect/404handler.php$is_args$args;
}
Here is an example of how your edited configuration could look like:
server {
#...listen, server_name, root, index...
location / {
try_files $uri $uri/ /linkautocorrect/404handler.php$is_args$args;
}
#...other configurations like PHP and SSL go here...
}
Other webservers
LinkAutocorrect will likely also work on other webservers with the correct setup, but we have not tested that. If you know how to make LinkAutocorrect work on other types of webservers, please contact us so we can add this information here.
Cloud deployments
If you run your website through a managed cloud service, you have the following options:
- Use the LMCS API
- Internally redirect
404 Not Founderrors to a traditional webserver and relay the response to users