SJamG Posted May 23, 2013 Share Posted May 23, 2013 Hi there, I am feeling very silly asking for help on this as it seems it would be PHP 101...: I have a website which uses PHP pages, my main site loads fine, however when i click any of the links in the menu (which should go to PHP pages) it returns a 404. For example, I have a PHP file on my root called properties.php which it should be loaded when i click the Properties link, but it doesn't. i also have an /admin directory, which contains php files (used for administering content), but it doesn't even load the login screen, instead takes me straight in! I have since deleted the admin folder to be safe just now. I contacted the hosting company in case i got the root path wrong (Godaddy), but they prompty/rudely told me it wasn't their problem I know this is really basic stuff, but if someone could point me in the right direction, i'd appreciate it. Thanks in advance! Jamie Quote Link to comment https://forums.phpfreaks.com/topic/278333-newbie-alert-new-site-cannot-find-php-pages/ Share on other sites More sharing options...
Jessica Posted May 23, 2013 Share Posted May 23, 2013 We can't do much without seeing your HTML and directory structure. Quote Link to comment https://forums.phpfreaks.com/topic/278333-newbie-alert-new-site-cannot-find-php-pages/#findComment-1431918 Share on other sites More sharing options...
buzzycoder Posted May 23, 2013 Share Posted May 23, 2013 It might be .htaccess issue.Have a look on that too if any! Quote Link to comment https://forums.phpfreaks.com/topic/278333-newbie-alert-new-site-cannot-find-php-pages/#findComment-1431920 Share on other sites More sharing options...
SJamG Posted May 24, 2013 Author Share Posted May 24, 2013 Hi, I will attach a screenshot of the structure and also i don't seem to have .htaccess file..... here is the screenshot : Thanks in advance for any further help Quote Link to comment https://forums.phpfreaks.com/topic/278333-newbie-alert-new-site-cannot-find-php-pages/#findComment-1432030 Share on other sites More sharing options...
SJamG Posted May 24, 2013 Author Share Posted May 24, 2013 Hi, i also created an .htaccess file with the content below : RewriteEngine On RewriteRule ^property$ /property.php RewriteRule ^property/([^/]*)$ /property.php?prop_id=$1 [L] RewriteRule ^admin/$ admin/ [L] RewriteRule ^([^/]*)/$ $1.php [L] RewriteRule ^property_images/([^/]*)/([^/]*)/(.*) /include/resize_image.php?width=$1&height=$2&file=$3 [L] Thanks Quote Link to comment https://forums.phpfreaks.com/topic/278333-newbie-alert-new-site-cannot-find-php-pages/#findComment-1432038 Share on other sites More sharing options...
mac_gyver Posted May 24, 2013 Share Posted May 24, 2013 you haven't shown us any of these links, but based on your statement about the "root path", you are attempting to use the server's file system path in links. the document root path is only relevant on the server for file operations and doesn't have anything to do with links that the browser requests. links are absolute/relative to your domain name not to root paths on the server. show at least one of the relevant links that doesn't work. if it contains any information you don't want to post, x that part of it out, but don't change the basic syntax of what you are posting. Quote Link to comment https://forums.phpfreaks.com/topic/278333-newbie-alert-new-site-cannot-find-php-pages/#findComment-1432040 Share on other sites More sharing options...
buzzycoder Posted May 24, 2013 Share Posted May 24, 2013 So,does creating .htaccess file solved your issue or still same? Quote Link to comment https://forums.phpfreaks.com/topic/278333-newbie-alert-new-site-cannot-find-php-pages/#findComment-1432089 Share on other sites More sharing options...
Ken_GoDaddy Posted May 25, 2013 Share Posted May 25, 2013 @SJamG, I'm with Go Daddy and just noticed your post and would like to see if I could help. Could you PM more information to me so I can review with our hosting teams? Please include your URL, as well as if you are seeing any specific errors, other than a 404 error when attempting to view your pages, and the steps you took to reach this point. Thanks for your patience, and as always, thanks for being a Go Daddy customer! Quote Link to comment https://forums.phpfreaks.com/topic/278333-newbie-alert-new-site-cannot-find-php-pages/#findComment-1432191 Share on other sites More sharing options...
SJamG Posted May 26, 2013 Author Share Posted May 26, 2013 (edited) Hi everyone, thanks for your posts. I created the .htaccess file..but i still have the same issue... I have tried to contact GoDaddy support about the root path in my config file, to which it was dismissed nor confirming it was correct or incorrect. I would be happy to post any file contents or any additional information you need - just tell me and i'll post it @Ken_GoDaddy - I will PM you, but in all honestly, i was very rudely dismissed by support with very little help...but will give you the URL and the info you request. Thanks for any help in advance. Edited May 26, 2013 by SJamG Quote Link to comment https://forums.phpfreaks.com/topic/278333-newbie-alert-new-site-cannot-find-php-pages/#findComment-1432383 Share on other sites More sharing options...
mac_gyver Posted May 26, 2013 Share Posted May 26, 2013 you need to troubleshoot to find out why your menu links are not valid. have you looked at the 'view source' of the page to try to identify what is wrong with the links? you either have a wrong protocol, domain name, path, file in them or some other error in the actual information making up the link. are you sure that the menu links don't work correctly, but something in the code on the target page of the links is then redirecting to the 404 non-existent page? what's the actual final url in your browsers address bar? we cannot possibly help you with this task without seeing at least one of the links to be able to identify what might be wrong with it. this isn't your web host's problem unless they wrote or sold you the script. all they are selling you is web hosting. it's not their job to setup or troubleshoot your scripts. Quote Link to comment https://forums.phpfreaks.com/topic/278333-newbie-alert-new-site-cannot-find-php-pages/#findComment-1432387 Share on other sites More sharing options...
SJamG Posted May 26, 2013 Author Share Posted May 26, 2013 Hi, I have sent you a PM - I don't really want our company's domain name on a public forum. I would also be willing to share FTP details to get this sorted. Failing all this - I will post a project on Freelancer.co.uk Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/278333-newbie-alert-new-site-cannot-find-php-pages/#findComment-1432425 Share on other sites More sharing options...
mac_gyver Posted May 26, 2013 Share Posted May 26, 2013 (edited) perhaps you missed my first post in this thread - show at least one of the relevant links that doesn't work. if it contains any information you don't want to post, x that part of it out, but don't change the basic syntax of what you are posting. your pm, less the actual domain names is information you should have included in the first post in this thread. no one here knew the issue is that a url like - yourdomain.com/properties or is it actually /property had anything to do with the problem. Since i'm not very good with url rewriting, i probably cannot help you beyond this, but here's the relevant and sanitized information from your pm that you should have just posted so that someone here could help you - We currently have a web site hosted with GoDaddy, which is an exact replica of two web sites we have hosted somewhere else. Everything is identical apart from the colours... When you navigate to the available properties page, www.somedomain.com/properties - it generates a 404 error....if I navigate to properties.php - it works. The other websites we have (two other domain names at a different host) all work absolutely fine on this model - that's why i'm convinced it's something to do with the .htaccess (although it has been copied from a working site) or the root path in the config file. in typing this reply, i realized that the .htaccess you showed references property, but everything else you have been typing is for properties. which is it? what does the actual menu link that doesn't work end in? yes, it matters, because computers only do exactly what they are told to do. Edited May 26, 2013 by mac_gyver Quote Link to comment https://forums.phpfreaks.com/topic/278333-newbie-alert-new-site-cannot-find-php-pages/#findComment-1432430 Share on other sites More sharing options...
mac_gyver Posted May 26, 2013 Share Posted May 26, 2013 i do have a question about your godaddy hosting, is it based on an Apache web server so that a .htaccess file will even work? if you have an IIS web server, a .htaccess file has no meaning. Quote Link to comment https://forums.phpfreaks.com/topic/278333-newbie-alert-new-site-cannot-find-php-pages/#findComment-1432435 Share on other sites More sharing options...
txmedic03 Posted May 29, 2013 Share Posted May 29, 2013 Need to confirm that GoDaddy allows mod_rewrite. It was previously mentioned that you have multiple nearly identical sites and the other two work in the expected manner. Are the other sites hosted with GoDaddy? Are the other sites separate accounts? Are the other sites using the same hosting package as the GoDaddy one that isn't working? Hosting packages typically come in three levels: Dedicated - You have a whole system all to yourself and you get ssh (or rdp for windows servers) access to configure and control the system with few or no guidelines for what you are allowed to do with the server. VPS (Virtual Private Server) - This is generally more restrictive than the dedicated servers, but does allow for quite a bit of control. These types of servers a virtual so you share resources of a physical server with multiple other VPS customers. Shared Hosting - These are the cheapest and most commonly used hosting packages. There is very little control over configuration and lots of restrictions on what you can do. You generally do not get RDP/SSH access and the resources are divided up for all the hosting packages hosted on that physical server. I am not extremely familiar with all the security minded restrictions that GoDaddy implements or if they offer anything other than shared hosting, but if you are on shared hosting then it is very likely that the options for configuration in the .htaccess file are very restrictive. The host can't afford to let you change anything that would negatively impact any other their other customers on that server and they can't spend all their time customizing configurations for each customer, so you get a one size fits most configuration. Hosts typically set very strict guidelines on what you can change via PHP, .htaccess, etc. That's just what happens to spring to mind atm anyway. Please, forgive me if I have misunderstood your question or if I have done nothing more than re-affirm things you were already aware of. Quote Link to comment https://forums.phpfreaks.com/topic/278333-newbie-alert-new-site-cannot-find-php-pages/#findComment-1432904 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.