404 page url link to custom domain on heroku ghost blog - heroku

I have deployed a Ghost blog on heroku. The app has the url app.herokuapp.com. I have setup a custom domain to point to this mydomain.com.
Things work fine in normal access conditions. However, when the user hits a 404 page mydomain.com/xyz, it takes me to the 404 page and then there is a link to the front page.
A click on this link leads me to the heroku app url(app.herokuapp.com) rather than my custom url(mydomain.com).
Please let me know how do I point it to the front page of my custom domain mydomain.com

You can serve a custom error page on Heroku, and you can point it anywhere you'd like.
https://devcenter.heroku.com/articles/error-pages

Related

ngnix - rewrite url based on path

I have my next.js app working on http://testdomain.amazonaws.com:443/abc.
Using ngnix configuration, I would like to have https://anotherdomain.com/abc to render my app at http://testdomain.amazonaws.com:443/abc without changing the url in the address bar and also it should take the routes from the next.js app keeping the https://anotherdomain.com.
That is, if user clicks on other links and navigates to other routes like
http://testdomain.amazonaws.com:443/abc/pqr/1 it should become https://anotherdomain.com/abc/pqr/1 in the url.
Can anyone help me understand if we can write a rewrite rule to achieve this in ngnix?

Laravel SPA (laravel + vuejs + sanctum) deployed in subdomain returns wrong api

I have this problem since several days.
I'm developing a Vuejs/laravel app, using Sanctum as an authenticator. where laravel mainly have the api gestion role, and I've started to deploying it. On Local, everything looks fine, api and auth are working.
On deploy, since my app is binded to be in a subdomain (laravelapp.maindomain with folder path of domain/laravelapp), when i try to access any page (vue-router) instead of domain/laravelapp/login i get domain/login, even if the page itself is looking fine.
If i try to reload the redirected page (domain/page) i have a 404. Also, since every API is pointing to domain/api/link instead of domain/laravelapp/api/link, everything is broken starting with auth.
I've tried modifying .env file, RouteServiceProvider, .htaccess(but i have no knowledge about that).
I also tried to set the subdomain Document Root to domain/laravelapp (it's the first thing i've done), but not only it dosn't work, if I try to print on screen subdomain's root, it returns domain. It's becoming a real issue right now, thank you for any help.
EDIT: I've discovered something. in the main domain there is a Joomla application. The api route contains the Joomla redirect (like, there is a plugin oh the site that changes language automatically, appending /en /it /de given the chosen language). So, in my case, the api is domain/index.php/en/subdomain. I tried again being more specific with document root, with no results, and playing around with .htaccess, but with no success.

How do I set a redirect for my root index.html in jekyll?

I have jekyll-redirect-from plugin, but it only really works for pages that aren't my root homepage.
For example, if a user types in www.mywebsite.com/index.html I want it to redirect and display the URL as www.mywebsite.com
Everything I can find about this is focused on blog posts and other pages than the index. Has anyone had this issue?
You don't need a redirect, because www.mywebsite.com/index.html and www.mywebsite.com are the same page. (The browser just shows the index file by default if you go to www.mywebsite.com.)
You need the browser to rewrite the URL, while remaining on the same page. You need to do this on the webserver.
.htaccess
If your site is on an Apache server and you have access to the server, you can use an .htaccess file to rewrite the URL from www.mywebsite.com/index.html to www.mywebsite.com.
There are online .htaccess generators like this one that help get the syntax right.
There are similar methods for rewriting URLs on nginx webservers.
GitHub Pages
If you're on a service like GitHub Pages, you can't use .htaccess. A free workaround is to use Netlify to deploy your site, because you can set up redirects on Netlify. Create a free account on Netlify and add a new site from GitHub there.
In the root of your repo, create a netlify.toml file containing this:
# Redirect /index.html to /
[[redirects]]
from = "/index.html"
to = "/"
Netlify will now handle that redirect.

Magento From local server to live web server, links not working

Now, the homepage is working fine but every link on it directs you to a 404 not found error. Can't even access "/admin".
Just add "index.php" next to the domain. For ex: If your website name is www.google.com then try to access this as www.google.com/index.php/electronics/cell-phones.html
This is due to the url rewrite in magento.
Permanent solution: Go to the admin and follow this:
System-> Configuration -> Web ->Search engine Optimization -> Url Web Server Rewrites. Make this to YES and SAVE the changes.
Now clear the cache and navigate to all the page in your website.

Using a custom domain with a Heroku hosted app

I am trying to point a custom doamin provided by Domain.com to my Heroku app. Everything works well unless I try to enter a direct URL past the normal landing page.
If I go to mycustomdomain.com I get the right landing page and can navigate throughout the site. However, If I go directly to a URL deeper insite the site such as mycustomdomain.com/widgets I get a 404 error. But, if I go to myapp.herokuapp.com/widgets everything works fine.
Another ofdity is that when I go to mycustomdomain.com no matter where I navigate the url is always diaplyed as mycustomdomain.com with nothing ever trailing.
This ended up being an issue with Domain.com's configuration. No matter what I tried I could not get the domain the redirect properly. I switched to GoDaddy and used the exact same configuration and everything worked great.

Resources