Routes not redirecting

My website URL is:
http://adamchoward.com

When I go to http://adamchoward.com/blog or any other route, I get a 404. I know this has to do with the webserver settings. I am using Angular 8. I need to configure the server to redirect from any route to index.html. How do I do this?

What I’m seeing is:

I’m using this software:

Additional information:

I can access it, so it’s a problem with your cache. Try clearing the cache from your browser’s settings.

I think you’re right about the server rerouting thing.

You can do this with .htaccess rules. From the top of my head, this might work:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [L]

Simply create a file in the htdocs folder of your website with the name .htaccess with the contents above, and it should work.

2 Likes

Hi there we are on the right track with the htaccess file. I seen it in the Angular Docs. Angular. I see that that is for an Apache server? Are you sure we are using Apache. If you notice now when you go to a route, you get redirected to the index. I set this up with page rules on Cloudflare. But it’s not the solution. I believe the htaccess file is the solution. I am going to disable cloudflare now and wait for htaccess file propagation. Can anyone confirm we are using apache web server?

Thank you, Admin.

I want it to route to the proper page. Not just redirect to home page.

UPDATE !!! IT WORKS, it was the htacess file THANK YOU SO MUCH ADMIN YOU HAVE A GREAT DAY/YEAR. Anything is possible. Woooohoooo. :slight_smile:

Slight problem. It works on desktop web browser but not mobile. Any thoughts?

Ok now it stopped working completely. Check it there yourself. I am getting a domain related keywords landing page.

Cloudflare page rules can do URL redirection. .htaccess can also do redirection, but the rules I posted above control how a requested URL is mapped to the files on your account.

And your website is fully working from here now. But it doesn’t seem to be using Cloudflare.

2 Likes

I get a stupid landing page when I access any URL route or no route? Is it working for you still?

Still stuck with this shitty landing page. like above. It’s like the server doesn’t know it has an index html. When I access it through a route, it works but when I try to go to the main domain url I get that domain not in use page.

Your website is still working from here. This particular page is an external parking service, not a page generated by our servers. So this is a DNS issue, if anything.

Can you please make a tracert from your computer to ns1.epizy.com and share the result here?

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.