Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
litespeed_wiki:config:understanding_404 [2018/05/24 09:06]
Tihomir
litespeed_wiki:config:understanding_404 [2018/06/14 16:26] (current)
Lisa Clarke [Missing /cgi-bin/ folder in document root] Proofreading
Line 1: Line 1:
-===== Understanding Error 404 Not Found =====+====== Understanding Error 404 Not Found ======
  
-In most cases this error is related to missing/​misconfigured file or webpage. When the user request that file or webpage the Litespeed web server will return the information that there is something wrong and it cant find that file. Lets see what can trigger that error and how to resolve it.+{{:​litespeed_wiki:​config:​404.png?400|}}
  
 +In most cases Error 404 is related to a missing or misconfigured file or webpage. When the user requests that file or webpage, LiteSpeed Web Server will return a 404 code. 404 indicates that there is something wrong, and LSWS can't find that file. Let's see what can trigger this error and how to resolve it.
  
-==== Missing file ====+===== Missing file =====
  
-Many templates include path to favicon.ico but not the actual ​icon and when you load your site you can see in the developer console line like:+Many templates include ​path to ''​favicon.ico'', ​but not the //actual// favicon, ​and when you load your site you can see in the developer console ​line like:
  
 <​code>​ GET https://​domain.com/​favicon.ico 404 </​code>​ <​code>​ GET https://​domain.com/​favicon.ico 404 </​code>​
  
-In that case the error is not fatal but its a good practice to resolve ​that. To do that simple ​find the included path for that icon and put it there. You can use that method to resolve not only missing ​favicon ​but other files too.+In this case the error is not fatalbut it'​s ​a good practice to resolve ​it anyway. To do so, simply ​find the included path for the favicon ​and then put the favicon ​there. You can use that method to resolve not only missing ​favicons ​but other files too.
  
-==== Missing Rewrite Rules ====+===== Missing Rewrite Rules =====
  
-This is the second most common reason for error 404. For example if you change permalink structure of your website but you did not put rewrite rules or redirects ​for that you will see the error. You can reverse the changes for permalinks or review your .htaccess file and put the right rules there.+This is the second most common reason for Error 404. For exampleif you change ​the permalink structure of your websitebut you do not put rewrite rules or redirects ​in place, LSWS won't be able to find the page's new location, and will return a 404. You can reverse the changes for permalinksor review your ''​.htaccess'' ​file and put the right rules there.
  
-==== Wrong Rewrite ​rules ====+===== Wrong Rewrite ​Rules =====
  
-If you put, for example redirect from your index page to home page, but the last one did not exist you will see again error 404. The same think can be apply if you put wrong rewrite rules. You can temp rename your .htaccess file from FTP client or with terminal command:+If you put, for example, a redirect from your index page to a different ​home page, but the home page does not existyou will see Error 404. The same thing can apply if you enter incorrect ​rewrite rules. You can temporarily ​rename your ''​.htaccess'' ​file from an FTP client or with the following ​terminal command:
  
 <​code>​ mv .htaccess htaccess-wrong </​code>​ <​code>​ mv .htaccess htaccess-wrong </​code>​
  
-or you can reverse the latest changes to that file.+Or you can reverse the latest changes to that file.
  
-==== Different Web Server ====+===== Different Web Server ​=====
  
-If you or your hosting provider change the web server for example to nginx in some cases you will see error 404. Some web server did not read the .htaccess file and you need to contact your hosting provider or you can manually make change ​to include the critical rules directly in the .conf/vconf file for that web server.+If you or your hosting provider change the web server ​(for exampleto NGiNX) ​in some cases you will see Error 404. Some web servers do not read the ''​.htaccess'' ​fileand you need to include the critical rules directly in the ''​.conf''​/''​vconf'' ​file for that web server. You may need to contact your hosting provider for help with that.
  
-==== Removed ​domain name ====+===== Removed ​Domain Name =====
  
-Depend ​on the server configuration in some cases when domain name is point to server but its not added there you can see the error. You can contact your hosting provider for additionally ​information or you can review the server if you have access.+Depending ​on the server configurationin some cases when domain name points ​to server but the virtual host doesn'​t exist, ​you can see a 404 error. You can contact your hosting provider for additional ​informationor you can review the server ​configuration ​if you have access.
  
-==== Wrong Document ​root ====+===== Wrong Document ​Root =====
  
-This is a command mistake when the new vhost is created ​and the user put wrong document root. In that case the web server will search for the files in different directory and when they are not there you will see error 404. +This is due to a command mistake when the new vhost is created, The user adds the wrong document root. In that case the web server will search for the files in different directoryand when they are not there you will see Error 404. 
  
-==== Changed NS server ​for a domain name ====+===== Changed NS Server ​for a Domain Name =====
  
-If you change the Name Servers (NS) for a domain name before ​configurate ​the domain/​webpage in the new location you can experience 404. Always change NS server after the domain/​webpage is properly working ​on the new location.+If you change the Name Servers (NS) for a domain name before ​configuring ​the domain/​webpage in the new locationyou can experience ​404. Always change NS server ​//after// the domain/​webpage is properly working ​in the new location.
  
-==== DNS cache ====+===== DNS Cache =====
  
-If you migrate your page to new server, change the NS servers for the domain and delete the content on the old server ​its posable ​to see error 404. That is because most of the ISP (Internet ​service providerhas DNS cache and your page is still loading from the old location. Its a good practice ​to not delete the content from the old server for 3-4 days to avoid that.+If you migrate your page to new server, change the NS servers for the domain and delete the content on the old server, it's still possible ​to see Error 404. That is because most ISPs (Internet ​Service Providershave DNS caching in place, ​and your page is still loading from the old location. Its a good practice not to delete the content from the old server for 3-4 days to avoid such an issue.
  
 +===== Missing /cgi-bin/ folder in document root =====
  
 +In a cPanel environment,​ under ''/​home/​USER1/​public_html'',​ there is no ''​cgi-bin''​ folder normally. However, in a cPanel Apache virtual host setting, you will find a ''​ScriptAlias''​ setting addresses this issue for Apache. LSWS, on the other hand, returns a 404 because the folder does not exist. Please check [[litespeed_wiki:​config:​redirect_cgi-bin_no_exist_404|this wiki]] to learn how to fix it.
  • Admin
  • Last modified: 2018/05/24 09:06
  • by Tihomir