0

I have implemented this change to .htaccess. RewriteEngine On RewriteCond %{HTTP_HOST} ^(www\.)?stakeholdermap\.com$ [NC] RewriteRule ^(.*)$ https://www.stakeholder-map.com/$1 [L,R=301]

stakeholdermap.com/stakeholder-definition.html resolves to stakeholder-map.com/stakeholder-definition.html.

But https://www.stakeholdermap.com/project-management/project-monitoring-and-control.html goes to https://www.stakeholder-map.com/home/stakehol/public_html/project-management/project-monitoring-and-control.html. I have checked for clashes on CF and there isn't anything.

Using just Redirect 301 / https://www.stakeholder-map.com/ works for first level pages, but I get: This site can’t be reached

The webpage at https://www.stakeholdermap.com/project-templates/excel-project-plan.html might be temporarily down or it may have moved permanently to a new web address.

ERR_HTTP2_PROTOCOL_ERROR

How do I get pages in subfolders to redirect correctly?

7
  • Sounds like some other internal rewrite might have already happened before this. Where in the already existing rewrite configuration did you put this? It should be one of the very first things you do.
    – CBroe
    Commented Jul 1 at 11:21
  • "Using just Redirect 301 / https://www.stakeholder-map.com/ works for first level pages" - it should work for everything; but if you have both domains pointing to the same webspace, and not made this dependent on the originally requested host name, this will of course cause a redirect loop.
    – CBroe
    Commented Jul 1 at 11:24
  • CBroe thanks for getting back to me. It is the first and only entry in stakeholdermap.com .htaccess. I am on with my hosting support in case something else is set. Perhaps in Httpd.conf? Commented Jul 1 at 11:42
  • 'if you have both domains pointing to the same webspace,' what do you mean by the same webspace? they on the same server and have same IP... Commented Jul 1 at 11:44
  • 1
    It might be that your hoster has already implemented some rewriting on an upper level, to get both domains pointing to the same directory to begin with - and that that has already changed the internal URL by the point this reaches "your" rewriting. Try and see if changing the RewriteRule to RewriteRule . https://www.stakeholder-map.com/%{REQUEST_URI} [L,R=301] changes anything. (Keep the rest, the RewriteEngine & RewriteCond statements. And test in a private browser window, otherwise already cached faulty 301 redirects might fool you.)
    – CBroe
    Commented Jul 1 at 11:52

0