Experimental project
This is a sandbox project, which contains experimental code for developer use only.
This module generates a RewriteMap file which can be used to redirect requests for internal URLs to the corresponding alias. This allows the redirect to occur on the Apache level instead of requiring Drupal to bootstrap in order to handle the redirect thus removing significant load from the webserver to handle the redirects.
Usage
- Install Drupal with Global Redirect module and this Global Redirect RewriteMap module.
- Go to admin/config/system/globalredirect and configure settings for Global Redirect and near the bottom are the options for this Global Redirect RewriteMap module. Use the manual generation button to create an initial RewriteMap file.
- The RewriteMap Apache directive cannot be used in the .htaccess context so the the following configurations must be placed in the server or virtual host configuration.
RewriteEngine On RewriteMap globalredirect txt:path/to/private/files/globalredirect_rewritemap.txt - Configure your .htaccess file to use the RewriteMap defined in step 3. Place these in your .htaccess just before the comment that says "# Pass all requests not referring directly to files in the filesystem..." You will also likely need to set the RewriteBase in your .htaccess.
# Global Redirect RewriteMap RewriteCond ${globalredirect:$1} > "" [NC] RewriteRule ^(.*)$ ${globalredirect:$1|$1} [R=301,L,NC]
Other notes
- This essentially caches alias data using cron so the data may become out of date if your aliases update rapidly. The tradeoff is faster performance versus possibly stale alias data.
- This is not tested with any type of multilingual configuration and it is assumed that it will fail under those cases. Not recommend for use on multilingual sites using URL for language detection.
- This is also not tested on any other setups that utilize any other type of URL detection such as Domain Access, etc. It may or may not work in those cases, not recommended.
Project information
Unsupported
Not supported (i.e. abandoned), and no longer being developed. Learn more about dealing with unsupported (abandoned) projectsMaintenance fixes only
Considered feature-complete by its maintainers.- Created by kerasai on , updated
