menu

ZEIT

Our mission is to make cloud computing as easy and accessible as mobile computing. You can find our Next.js community here.

Channels
Team

404 error, sometimes....

February 19, 2019 at 12:42pm

404 error, sometimes....

February 19, 2019 at 12:42pm

Sometimes, and not always. I try to reach my now deployed site without www and reach a 404 page. Most of the times I am redirected from onefinaldoc.com to www.onefinaldoc.com.

I don't understand what is happening.

onefinaldoc.com
id name type value created
CAA 0 issue "letsencrypt.org" default
* ALIAS alias.zeit.co. default
ALIAS alias.zeit.co. default
rec_e9d362dd840002c053e052af 20190119122642pm._domainkey TXT k=rsa; p=MIGf...1LwwIDAQAB 22d ago
rec_ba26b1b814893b23e6c9f7c6 4qwknyegpu6q CNAME gv-23vwolfun2ubda.dv.googlehosted.com. 29d ago
rec_f5a69a2824aed6b6866a0af7 app CNAME smelly-brake.surge.sh. 20d ago
rec_72b5803007a3c56124840c65 email.inbound CNAME mailgun.org. 19d ago
rec_c6c2d1f063d3506137ffef2b inbound MX 10 inbound.postmarkapp.com. 29d ago
rec_98d132d2a914a3103eadac72 inbound MX 10 mxa.mailgun.org. 19d ago
rec_38df7c265519ba723c6a7ecd inbound MX 10 mxb.mailgun.org. 19d ago
rec_c4900309137f86ea303bc6f5 inbound TXT v=spf1 include:mailgun.org ~all 19d ago
rec_1e9e7d412ca7d00f3d6e9a52 just MX 10 inbound.postmarkapp.com. 22d ago
rec_f6e9e05c26630cda621167fd MX 1 aspmx.l.google.com. 29d ago
rec_f9fd9af96bc7c8f7e90b390c MX 5 alt1.aspmx.l.google.com. 29d ago
rec_9817fbb59243fff6efc16f1b MX 5 alt2.aspmx.l.google.com. 29d ago
rec_8f5c2d5bbc4eff3754cffdc7 TXT google-site-verification=r_UjAD3BsRBplQA...Z3lmgdzx6gIJxrvM3Oc 29d ago
rec_66df24b14733db0ab356ea3e pic._domainkey.inbound TXT k=rsa; p=MIGfMA0G...1jazawIDAQAB 19d ago
rec_a96aff83fcca9abac9ba73c3 pm-bounces CNAME pm.mtasv.net. 29d ago

February 19, 2019 at 1:31pm

I even tried to change my now.json to redirect 404 to www.onefinaldoc.com but it didn't work.

  • reply
  • like
  • reply
  • like

And... strange that this happens, as I have this on my nuxt:

  • reply
  • like

<script> export default { asyncData({ redirect }) { return redirect('/') } } </script>

  • reply
  • like

pages/*.vue

  • reply
  • like

Found out when it shows 404, when I try https://onefinaldoc.com/, if I just put onefinaldoc.com in the browser, it works.

  • reply
  • like
  • reply
  • like

If I understand your problem correctly, it should be a matter of: https://zeit.co/guides/redirect-from-www/

  • reply
  • like

Let me know how it goes./

  • reply
  • like

February 20, 2019 at 1:12am

I did it. My now.json:

"version": 1,
"name": "ofd-site",
"alias": "www.onefinaldoc.com",
"routes": [
{
"src": "/(.*)",
"status": 404,
"headers": {
"Location": "https://www.onefinaldoc.com/"
}
}
]
}
  • reply
  • like

The only difference is that it does not have the $1 in the end of the URL in Location

  • reply
  • like

February 21, 2019 at 1:48pm

I got a message saying that routes only work on v2

  • reply
  • like

I identify that I get an error when someone points to https://onefinaldoc.com

  • reply
  • like

I got a message saying that routes only work on v2

Routes is a Now 2.0 feature, even if it is only a routing configuration.

  • reply
  • like

But what should I do now? https://onefinaldoc.com is returning 404.

  • reply
  • like

Do this: 1- This will be a new deployment! 2- Create an empty folder. 3- Create a now.json:

{
"version": 2,
"name": "ofd-site-redirect",
"alias": "www.onefinaldoc.com",
"routes": [
{
"src": "/(.*)",
"status": 301,
"headers": {
"Location": "https://www.onefinaldoc.com"
}
}
]
}

4- now && now alias

Edited
  • reply
  • like

'*' points to alias.zeit.co. in dns

Edited
  • reply
  • like