Hello, so i have a music website and when ever i click on a link it directs me to a 404 error page not found page. I have enabled mod_rewrite but i still redirects me to a 404 error page
Some possible explanations which come to mind:
- You are linking to files which don’t exist. Check whether the files you are trying to reach actually exist where they should be.
- Your rewrite rules are incorrect, so they are not applied properly.
- Your script receives the rewritten URLs but can’t route them.
Which of one those applies to your website is hard to say without actually seeing the website.
One caveat: if your website works on your own computer but doesn’t work on your hosting account, note that files and folder are case sensitive on your hosting account (and all other Linux systems) but not on Windows or OSX. So if you have a link to “about.html”, your file needs to be called exactly that. “About.html” and “about.HTML” are invalid and will give you a 404 error.
Here is my website, albanianmusic.rf.gd i’m soon going to uppgrade but i’m developing it right now
Here is my website, albanianmusic.rf.gd i’m soon going to uppgrade but i’m developing it right now
I’ve checked your .htaccess and I could see why the urls don’t work.
You have turned mod_rewrite on, however you haven’t used it. You need to add rewrite rules to actually be able to handle routing in your application. mod_rewrite won’t do anything unless you tell it which urls it should route and how they should be routed.
Hello, thx for checking it. I don’t really know how i can do the thing you said because i’m new to this whole .htaccess thing
Nvm, i did the RewriteRule but now other pages dosen’t load the css
Nvm, i did the RewriteRule but now other pages dosen’t load the css
Don’t forget to configure your RewriteRules to only rewrite missing urls. If you don’t the links to other files in your account may be rewritten as well. Usually, that can be done by adding the following lines just above the actual rewrite rule:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
I’ve done that but the doesn’t load in other pages only in the index
I’ve done that and it still doesn’t load the head in other pages only the home
I’ve done that still dosen’t work
I did that but it still doesn’t load
I did that but it still doesn’t load
After viewing the HTML which was returned by the other pages it looks like a lot of content from the start and end of the page are missing. That’s not a rewrite rule or server issue, that’s a code issue.
Oh ok, thx for your help