I love the Google sitemap generator for WordPress, so much so that I donated to the cause. I have a slight issue, though. Currently my WordPress installation is in a subfolder /blog/ and I am in the process of using complicated Mod_rewrites to make it appear at the root folder. When I did manage to make it happen, my sitemap still contained the /blog/ element in all the links, meaning Google wouldn't crawl the new structure, but the old. I rebuilt the sitemap, but to no avail. Any suggestions on how to get the sitemap to cooperate?
msanstx
Member
Posted 4 years ago #
Hi Wesg,
I also have a few WP installs at /blog/. I'm not sure what you mean by complicated mod_rewrites - WordPress handles an install at /blog out of the box (so to speak) and writes the mod_rewrite rules in the .htaccess file for you to get rid of the /blog. If you hand wrote the mod_rewrite rather than let wordpress do it for you, that may be affecting your permalink structure.
What's your General Options look like? WordPress should read http://www.yoursite.com/blog and Blog address should read http://www.yoursite.com. That sets the mod_rewrite (and your permalinks) to hide the /blog. From there, the sitemap plugin should work fine.
You can also set a custom location for a sitemap under Options -> XML Sitemap. I have mine set to the top level of the server as it will default to /blog.
Hope that helps.
I did manage to set up the blog so the real website root was the blog index page, and the mod rewrite was meant to redirect page views from /blog/ to the website root. I just figured that out, so once I can get the sitemap to work properly, I will be changing my site to the blog appears on the main page.
In the options panel, I have the URL of the blog set to http://www.mysite.ca and the blog installation set to /blog. My sitemap is in the server root page.
With this setup the sitemap creates properly, but each URL shows "/blog/" before the entries.
msanstx
Member
Posted 4 years ago #
Sorry...I misremembered the install and was thinking the .htaccess is different for a /blog install. Now that I look again, it's standard. Here's mine from a working /blog install (with the sitemaps plugin also working):
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
I followed the special instructions here: http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory
That requires copying and modifying a few files up a level - .htaccess and index.php. I notice on your site that you also have /blog in your permalinks (that's were sitemaps gets it's urls). With this install method, the /blog won't exist at all in your permalinks.