I need to setup many 301 redirects after migrating our site to Percussion and modifying the navigation. What is the best way to go about this? I was going to edit the .ctaccess file in the root directory, but I can’t seem to find it. I plan on creating the .ctaccess file and adding in the redirect info, but I wanted to make sure there was no better way to go about this task first. Any suggestions?
OK, lets retry this. The Apache documentation says,
“However, in general, use of .htaccess files should be avoided when possible. Any configuration that you would consider putting in a .htaccess file, can just as effectively be made in a section in your main server configuration file.”
I assume they mean this file
C:\Percussion\rxconfig\Server\config
Ok, any tips on the best way to go about this? I’m in over my head and would hate to cause irreconcilable damage to the site by altering the wrong file or worse.
Also, I’m having issues with Screaming frog or other tools scanning my site, as in they won’t scan past the first page. This error is being caused by invalid HTML markup. According to W3C validator I’m missing the content-type header. How can I fix this in Percussion? I need to fix this so I can use one of these tools to do my 301 redirects and start in depth SEO.
As far as I’m aware, that config file you’re looking at doesn’t have anything to do with Apache. That file is a part of CM1, which is separate from your web server (Apache). The Apache config file’s location depends on it’s install location. Do you know if it’s installed on the same machine? If so, try looking under “C:\Program Files\Apache Software Foundation\Apache2.2”. That’s the default Apache install location (your install could be somewhere else, though). There should be a “conf”" directory, which probably has a httpd.conf file. That’s your basic Apache configuration file.
If Apache is installed on a separate machine, you’ll need to find the configuration file on that machine. If you don’t know where it’s installed, you could try looking at the CM1 publish destination and see if that gives you any clues.
Hi John,
Percussion doesn’t currently provide any tools to assist with the configuration of server-side redirects. Because of our decoupled architecture (separating the CMS from the web server), setting up server redirects is typically managed by a customer’s server admin.
Also, I believe you’re actually running Apache Tomcat as your web server, not Apache HTTPD, so you won’t be working with .htaccess files, etc. For Tomcat, you’ll want to look into setting up UrlRewriteFilter, which is a redirect filter for Tomcat that provides similar capabilities as Apache HTTPD’s redirect modules. This thread outlines the best way to set this up with our deployment of Tomcat:
https://community.percussion.com/t/setting-up-redirects-for-tomcat-server/430
I will strongly caution you, because your site is already live, that these steps should really be performed by someone with server administration experience to avoid the risk of significant downtime. I understand that we will be reaching out to you with a quote for additional services shortly, so you may want to hold back on this until you’ve purchased these services so that someone on our end can configure this for you.
If you’re situation is like ours, you need to set a content-type header because CM1’s index files (and other pages, if you don’t manually add them) do not have file extensions (i.e. .html or .htm). The server uses file extensions to decide what kind of file it’s serving, and thus what to set the content-type header. Since CM1’s index files and other pages don’t have file extensions, the server doesn’t know what they are.
Content-type headers are important, because they tell the browser what type of file it’s receiving (HTML page vs. an image, for example). You want these files to be served with the type “text/html”, since that’s what they are (I assume we’re talking about standard web pages here).
You can set a default content-type, so that the server will assume files are of a certain type if they don’t have a file extension. (I don’t know if that’s the best practice, but it’s what we’re doing right now. If someone knows better, please let me know!)
In Apache, you should be able to set a default content-type by adding this directive to your configuration:
DefaultType text/html
Try adding that to your Apache configuration file (preferably on a test system) and restarting Apache. Your pages should have the proper content-type header now.
Disclaimer: I’m more familiar with nginx (a different server program) than Apache, so I may be mistaking how Apache does things. Also, this is web server administration stuff, and if you do this on a live system, you could end up temporarily bringing down your page until you fix the config file.
Thanks Nathaniel. I was supposed to get a quote for services a week or so ago. Can you have someone send that over as soon as possible. I don’t want to screw anything up and it sounds like this is better left to an experienced professional…and I can’t fix all my external 404 errors until then!
Great! I just checked, and that quote should be coming through momentarily. Let me know if it does not.