Forum Moderators: phranque
I have the full url in the 404 error.Do you mean in the ErrorDocument directive? I hope not, because that's a serious error whether on a live site or MAMP. Or is there an internal redirect in the 404 page itself?
[edited by: lucy24 at 9:35 pm (utc) on Oct 21, 2017]
also if I click on one of the menu links
it reverts to the online site's 404 page
@phranque I took out the external www Fix and moved the external extensionless redirect above the internal. However, I don't understand what you said about it's redirecting to the canonical hostname. Can you show me where it is redirecting to the canonical hostname?
RewriteRule ^(.+)\.html$ http://example.com/$1 [R=301,L]
RewriteRule ^(.+)\.html$ http://localhost/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+\.)+html\ HTTPyou need only say RewriteCond %{THE_REQUEST} \.htmlYou've already captured in the body of the rule, so there's no need to get complicated. (And no matter what you do, the parentheses aren't needed.) The alternative is to turn it around and capture from the Condition instead: RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+\.)+html\ HTTP
# externally redirect to extensionless URI
RewriteRule \.html$ /%1 [R=301,L]
it reverts to the online site 404 pageYou've said this a couple of times and I'm confused. Does your browser's address bar say
[edited by: phranque at 2:56 am (utc) on Oct 24, 2017]
[edit reason] unlinked url [/edit]
I then type in /contact.html and the browser goes here: http://example.com/home/user/public_html/contact.html (however it's the online 404 page without header/menu/footer (text only).
i would check the server configuration files for Redirect/RedirectMatch (mod_alias) or other mod_rewrite directives not posted above.
[edited by: phranque at 8:18 pm (utc) on Oct 24, 2017]
[edit reason] Unlinked URLs for clarity [/edit]
[edited by: engine at 8:01 pm (utc) on Oct 25, 2017]
[edit reason] fixed links [/edit]
IT WON"T LET ME COPY THE DATA.
https://aus5.mozilla.org/update/6/Firefox/56.0/20170926190823/Darwin_x86_64-gcc3/en-US/release/Darwin%2013.4.0/ISET:NA,MEM:3840/default/default/update.xml?force=1
GET /update/6/Firefox/56.0/20170926190823/Darwin_x86_64-gcc3/en-US/release/Darwin%2013.4.0/ISET:NA,MEM:3840/default/default/update.xml?force=1 HTTP/1.1
Host: aus5.mozilla.org
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:56.0) Gecko/20100101 Firefox/56.0
Accept: */*
Accept-Language: iu,en-US;q=0.8,en;q=0.7,no;q=0.5,de-DE;q=0.3,la;q=0.2
Accept-Encoding: gzip, deflate, br
Cache-Control: no-cache
Pragma: no-cache
Connection: keep-alive
HTTP/1.1 200 OK
Cache-Control: public, max-age=90
Content-Security-Policy: default-src 'none'; frame-ancestors 'none'
Content-Type: text/xml; charset=utf-8
Date: Thu, 26 Oct 2017 04:05:30 GMT
Strict-Transport-Security: max-age=31536000;
X-Content-Type-Options: nosniff
X-Proxy-Cache-Status: MISS
Content-Length: 42
Connection: keep-alive
That's just the headers I got from opening the About Firefox window to confirm my version number. i would use a header checker tool such as Live HTTP headers for FF or the Network tab in Chrome developer tools so you understand exactly what requests are being sent from the browser and what responses are received from the server.
I tried 5 other Firefox addons before I found one that looked like what is needed (live http headers)
[edited by: phranque at 1:48 am (utc) on Oct 27, 2017]
[edit reason] unlinked urls [/edit]
http://localhost/long-complicated-path
GET /assets/caret2-white.png HTTP/1.1
...
Referer: http://localhost/aascc.css What, if anything, does aascc.css have to say about caret2-white.png ? GET /faqs/images/smart-chiro-logo320b.jpg HTTP/1.1
..
Referer: http://localhost/faqs/ Again: what, if anything, does /faqs/ (which I assume physically means /faqs/index.html) have to say about smart-chiro-logo320b.jpg ?