Just one more question for now - I realize that you don't approve of me sending all redirects to my home page, but if I truly want to do it that way, is it possible? What would be the code in my htaccess necessary to achieve that?
As noted before, you can either use ErrorDocument and have your error document redirect to wherever, or use RedirectMatch or RewriteRule (with the R=301 flag) to match specific outdated URLs. To match alternates in a regular expression, use a vertical bar: "
mob(ile)?|iphone|m". Are there no longer pages corresponding to the URLs you list? If there are, you should redirect the old URLs to the new ones.
Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /index.html [L]
sorry but im a bit confused here. if my website is
www.mysite.com and people just enter a random url like
www.mysite.com/sdfdsf which does not exist, they will get x10hosting error 404. so if i change this will the problem be solved? as in the user will be redirected to the homepage? thanks.
What problem? If a user enters a random path in a URL that doesn't name a resource, a "Not Found" response is entirely appropriate: the user asked for something by a non-existent named. If you called an office and asked to talk to a Arthur Putey, and Arthur didn't work there, you don't get transferred to the front desk, you get told there is no Arthur Putey. Think how confusing it would be if you asked for Arthur, the phone rang, and you end up talking to someone else. Similarly, the user should get a "Not Found" page with links to the main page and other major pages (read up on other
"Not Found" error document design points).
What the code does is when a URL doesn't resolve to a directory or file, internally redirect to /index.html. This can hurt your search engine rankings as different URLs will have
duplicate content; adding an [R=301] flag will fix this issue. You also want to make the RewriteRule the last one in .htaccess. Personally, I find it counterproductive.