Reputation: 1948
I have a nodejs ghost application running on my shared hosting A2 provider. The application is a ghost instance listening at port 50754.
Since I have multiple domains, call it a.com & b.com, assuming the ghost instance must respond at b.com, I created an .htaccess file following simple rules expressed by the hoster, to create a configuration to redirect the surf to the correct nodejs running port.
The .htaccess configuration code is
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?b.com$ [NC]
RewriteRule ^$ http://127.0.0.1:50754/ [P,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTP_HOST} ^(www.)?b.com$ [NC]
RewriteRule ^(.*)$ http://localhost:50754/$1 [P,L]
</IfModule>
The strange thing is, if I surf to b.com or www.b.com, the returning address will be http://www.b.com/index.html.var/, that address not recognized as a valid one will generate an error in the ghost application.
The other strange thing is if I surf to other URIs, for instance, b.com/tags, everything works, but if I try to reach the root I got the strange path and thing will not work as expected.
The latest strange thing is, on the first time both b.com
& www.b.com
had worked fine, after (some?) first time the strange path appeared and now any URI address I configure always receives an error surfing to ...root/index.html.var/
I tried many solutions but nothing seems to work to restore the correct handling of the ghost home page.
Upvotes: 1
Views: 405
Reputation: 31
If you can post here the site config of the apache server it will be great. It seems the problem is not in your .htaccess but in your /etc/apache2/sites-available/.conf
Try to post them here and maybe I could be more useful :)
Upvotes: 1