Admin

Rules and redirects with htaccess

htaccess is a powerful tool that manages your site's URL structure and other settings. You can use it to create custom redirects, "vanity URLs", and define settings for templates. To edit htaccess, visit Admin > htaccess. You must have Site Administrator privileges for the site in order to use this tab.

How the CMS works with htaccess

Whenever new content is published, that site's htaccess file is rewritten to add a URL for the page. Therefore, any of your own custom htaccess rules must be added via the CMS htaccess tool for them to be included in the file. Rules entered into the .htaccess file manually via FTP will be overwritten in the near future the next time new content is published.

Creating a custom redirect

One common use of htaccess is to create custom URL redirects. Sometimes you may want to promote a simpler URL like http://yoursite.com/strategy instead of http://yoursite.com/resources/strategic-plan.

To create this redirect, go to Admin > Site > htaccess and enter a new line:

Redirect /strategy /resources/strategic-plan

In Redirect syntax, there needs to be a space in between "Redirect", the custom URL ("/strategy") and the full URL ("http://www.yoursite.com/resources/strategic-plan").

Existing pages

Redirects may not work as expected if there is a Page in the Pages module which is already using the URL that you wish to redirect. So, in our example, there should not be a Page already using the URL "/strategy". If there was, you may place the Page into Draft mode and the URL will be free for use again.

htaccess comments

You can safely add a note (called a comment) inside htaccess by beginning a line with a hash "#" sign. You can also disable existing rules this way, keeping the rule handy for the future. 

# Redirect /conference /event/our-big-conference-2018/

htaccess errors

Rules using "Redirect" or "RewriteRule" will be marked with ###ERROR### if the proper syntax for the rule is not used. To enable these rules, correct any syntax issues and also remove ###ERROR### from the beginning of the line.

Apache documentation

Here you can find the related official documentation for Apache HTTP Server v2.4, used by Ekklesia 360:

Redirect

RewriteRule

 

 


Article Rating
Was this article helpful?*

Additional Article Feedback

See more in Admin →