We are getting OJS set up and right now I’m working on SEO while everything is importing. I’ve tried plugging the OJS-generated sitemap into Google Search Console to ensure everything is picked up, and Google says it’s unreadable.
I reached the sitemap from https://journal.bahaistudies.ca/online/management/settings/distribution
When I access the sitemap from the provided URL (https://journal.bahaistudies.ca/online/sitemap) it displays XML.
XML Contents
<urlset xmlns="https://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://journal.bahaistudies.ca/online</loc>
</url>
<url>
<loc>https://journal.bahaistudies.ca/online/user/register</loc>
</url>
<url>
<loc>https://journal.bahaistudies.ca/online/login</loc>
</url>
<url>
<loc>https://journal.bahaistudies.ca/online/about</loc>
</url>
<url>
<loc>https://journal.bahaistudies.ca/online/about/submissions</loc>
</url>
<url>
<loc>https://journal.bahaistudies.ca/online/about/editorialTeam</loc>
</url>
<url>
<loc>https://journal.bahaistudies.ca/online/about/contact</loc>
</url>
<url>
<loc>https://journal.bahaistudies.ca/online/search</loc>
</url>
<url>
<loc>https://journal.bahaistudies.ca/online/issue/current</loc>
</url>
<url>
<loc>https://journal.bahaistudies.ca/online/issue/archive</loc>
</url>
<url>
<loc>https://journal.bahaistudies.ca/online/issue/view/1</loc>
</url>
<url>
<loc>https://journal.bahaistudies.ca/online/article/view/3</loc>
</url>
<url>
<loc>https://journal.bahaistudies.ca/online/article/view/3/2</loc>
</url>
<url>
<loc>https://journal.bahaistudies.ca/online/article/view/1</loc>
</url>
<url>
<loc>https://journal.bahaistudies.ca/online/article/view/1/1</loc>
</url>
</urlset>```
On Google’s side, I’ve added the sitemap URL and got errors right away.
I’ve tried adding .xml
to the end but it results in a 404. It seems like maybe it’s the non-standard issue of having no file extension on the sitemap that is causing the issue. I’m curious: does the sitemap normally have .xml
appended to it and does it normally work in Google Search Console?
It occurs to me that if OJS normally produces a URL with .xml
then maybe it’s my .htaccess
file causing the problem. I’ll paste it below in case that helps.
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^.*/index.php/.*$
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
# Bugfix for OJS 3.2.0-3: submissions API doesn't work with shortened URLs
RewriteRule ^api/v1(.*)$ index.php/online/api/v1$1 [L,R=307]
I’m using OJS version 3.2.1.2 on LAMP. If you need additional information, I’m happy to provide it.