For SEO, you want the search engine bots to index the right content in the right places. And as life changes sometimes you need to move your content around.

Google bot in this example is trying to index a page on our blog that we removed. We still want googlebot to be happy and the more pages in their index the better. Well, assuming you have good content because they don't call it content marketing without reason.

Looking at our google search console for https://blog.tendenci.com I see one error.

Google Search Console Error Needs Redirect

On the server *** itself, there is a hidden file named ".htaccess". Note the "." prefix which means it is a hidden file that the server typically would be configured to deny serving publicly. 

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Redirect 301 /tendenci-jobs/ https://www.tendenci.com/jobs/
RewriteRule ^(schipulcon-schedule-and-robots/.*)$ https://www.tendenci.com/videos/ [L,R=301,NC]
</IfModule>
# END WordPress

There is a lot going on here so let's look at the one specific line I'm interested in.

Redirect 301 /tendenci-jobs/ https://www.tendenci.com/jobs/

The .htaccess file is located on our blog, so the /tendenci-jobs/ URL is "relative" meaning it doesn't need the domain name in it. But the redirect is pointing to an entirely different domain. "www" and "blog" are the host names. From the Internet's perspective these are two very different web sites. Hence the second part of the line of code above points to the FQDN (fully qualified domain name) of https://www.tendenci.com/jobs/

The next time google bot visits, it will see we have permanently redirected (that's the "301" part) that URL to a different location.

Bonus round - what if you want to redirect ALL pages under a URL to a different web site entirely? That's what this line does. Note the asterist "*" at the end of the first directive.

RewriteRule ^(schipulcon-schedule-and-robots/.*)$ https://www.tendenci.com/videos/ [L,R=301,NC]

For more on server configuration for Tendenci and maybe you want to help write some docs for the Open Source AMS, visit our open source readthedocs pages and submit a pull request! We welcome you to join the AMS Community. And we hope to see you on github soon!

 *** Note: .htaccess, while it works with NGINX, is a technology from the Apache web server. Thus the implementation is different. Read the docs on nginx for more information.

 

 

 

 

Sign up for our Tendenci Open Source AMS Newsletter for more. Sign-up Now!

Contact us to upgrade to Tendenci

The open source solution chosen by associations around the world.

Want to talk? (281) 497-6567

Sign up for Tendenci - The Open Source AMS

No per user pricing. Unlimited admins.

Demo Now

Have Questions?

Contact us!

Site Search



I agree

Our site saves small pieces of text information (cookies) on your device in order to deliver better experience and for statistical purposes. You can disable the usage of cookies by changing the settings of your browser. By browsing our website without changing the browser settings you grant us permission to store that information on your device. See our Privacy Policy