Page 1 of 1

Redirect Removed Pages - where to put your redirection code

Posted: Thu Jul 24, 2014 7:03 am
by catchlight
Hi,

First up I'm using CMSMS 1.11.10 “Pinzon” as I write this.

I'd like to propose a one line text addition to this docs page (http://docs.cmsmadesimple.org/customizi ... oved-pages) that clarifies exactly where to place your 301 redirect within your sites htaccess file.

In the .htaccess file, I found that placing a redirect just before this stuff...

Code: Select all

# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
Seems to work. Placing it after doesn't. :'( Much time wasted finding this out and I'm sure others must have struck this.

For a real win, perhaps we could also have a new comment added to the htaccess.txt file that ships in the doc directory of CMSMS.

Something along the links of

Code: Select all

# Place your 301 redirections here
# For more information visit http://docs.cmsmadesimple.org/customizing/redirect-removed-pages
This is a very high ranking page when researching the topic of 301 redirecting with CMSMS, so I think it's important. We'd just need some input from developers what to actually say.

Re: Redirect Removed Pages - where to put your redirection c

Posted: Wed Aug 13, 2014 4:40 pm
by DIGI3
Thanks, documentation has been updated. It probably won't get added to the default htaccess file as it's a bit out of the scope of what we can offer support for, but certainly worth documenting.