Site link: http://www.stmatthias.co.uk

Basically, what i find is that whenever i try to refresh any page on my site, it takes you to the index.php

There is also an issue that when i go on a page, say the about us page, it still says www.stmatthias.co.uk, instead of www.stmatthias.co.uk/about.php/

Any page entered in other than www.stmatthias.co.uk brings up the index page, and there is no custom 404 page which say if you type in www.stmatthias.co.uk/nonexistantpage.html comes up,

Thanks for your help,
Hope i made myself clear, not sure what i have done for this to happen,

Dani AI

Generated

— this behavior usually comes down to one of three things: the site is being shown inside a parent frame/iframe so the browser URL never updates, client-side JavaScript is loading page fragments (AJAX) without updating the location, or the server is routing every request to the homepage (a front-controller / rewrite). was right to ask about JavaScript, and 's frameset idea is also worth checking — both are plausible and the tests below will quickly tell you which one it is.

First, narrow the cause. Right‑click -> View Source (or Ctrl+U) and search for the words frameset, frame or iframe. If you find frames, right‑click the content area and choose “Open frame in new tab” to see the real URL. If there are no frames, open Developer Tools Network tab, click a menu link, and watch what URL the browser requests and what HTTP status you get. If clicking generates only XHR requests (200s for fragments) and the address bar stays the same, it’s client JS. If a direct request for a specific filename (for example /about.php) returns the homepage HTML with HTTP 200, you likely have a rewrite/front controller in the server config.

Quick fixes:

  • If it is frames: remove frames or force links to load in the top window. For a quick test try changing a nav link to target="_top" (for example <a href="about.php" target="_top">About</a>).

  • If it is JS/AJAX: disable JavaScript to confirm, then either add proper history.pushState() calls when swapping content or provide real, crawlable links.

  • If it is server rewrites (Apache): ensure your rewrite rule only forwards requests when the file/dir does not exist. Example .htaccess pattern:

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . index.php [L]

Because you self-host on a Mac, also check Apache vhost/.htaccess and the access/error logs to see what path is actually being requested. Back up .htaccess or configs before editing and test in an incognito window. Frames are dated and cause SEO/usability problems — moving to server-side templates or a proper client-side router with history support will solve this cleanly.

Recommended Answers

All 9 Replies

Have you got some js to redirect ppl to the home page? Or maybe some server side member validation that locks visitors out until the "log in"?

Maybe your hosting provider has a permissions issue for your site, or you set one up and forgot. It could be a number of things that we, on this side cant tell.

Try commenting this section of js with a comment like so:

/*
<script src="js/login.js">
// Login Form
$(function() {
var button = $('#loginButton');
var box = $('#loginBox');
var form = $('#loginForm');
button.removeAttr('href');
button.mouseup(function(login) {
box.toggle();
button.toggleClass('active');
});
form.mouseup(function() {
return false;
});
$(this).mouseup(function(login) {
if(!($(login.target).parent('#loginButton').length > 0)) {
button.removeClass('active');
box.hide();
}
});
});
</script>
*/

and see what thats does.

Actually, thats not the cause at all. I think its the frameset you're using. All pages have the same URL if you click through the menu to your other pages. The URL stays the same. hmmm not sure what to tell you at this point.

its highly confusing, were are self hosting on a mac server, and im not sure what the settings are, ill take a look into the login as it may be a possibility.

I think the problem might be the frameset itself. It's src attribute is always set to "" which retrieves the homepage. Regardless of whichever link you click, when the page loads it will come to the frameset part and retrieve the page pointed to by the src attribute.
So, i think if you really want to keep your frameset in your html, then in each of your .php pages, change the frameset src attribute to the respective php file.
eg. In about.php change the the frameset src to "about.php", etc
Try that and inform us.

I dont understand which part of the document is related to the frameset, i tried researching it but i am unsure.

Hey. Tried your site. All seems fine to me. Is it a particular browser you are using?

Im using Chrome, i tried it in opera and IE9. Same issue in both. What are you using?

I see no issue here. I am using Chrome.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.