Jump to content

Newbie Alert! - New site cannot find PHP pages?!?


SJamG

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

@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!

Link to comment
Share on other sites

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 by SJamG
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by mac_gyver
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.