0

I have in my Navigation bar: "example.co/index.php (home), example.co/action.php, example.co/car.php /etc".

Now I have my games in the "/games/" directory

But once I click on a game in /games/ directory "example.co/games/mario" //(that's what I want my games to be called)

EVERYTHING on the page scopes to games/ directory. For example example.co/index.php becomes example.co/games/index.php

example.co/games/action.php

(It shouldn't do that. It should remain example.co/index.php) And then things start breaking 404 error.


I don't know if .htaccess is exactly necessary. But I believe I could make this work if I put EVERYTHING In public_html directory. and then used .htaccess to change games/ name. But I don't know the code to use...

Perhaps something along the lines of

# Rewrite for (ALL the games).php
RewriteRule ^games/(ALL the games).php [NC,L]

Any ideas? I'm just clueless there's 1000 possibilities here... I'd rather not drive myself crazy moving unnecessary files around.

  • 1
    Don't ... rig around the problem - solve the problem. The question is why is a reference to /games/ doing what it is doing?? (which for me is not entirely clear from your description) Can you post your .htaccess file and tell us what CMS or other software you are using?? – closetnoc Dec 15 '15 at 1:54
  • Theres nothing in my .htaccess file. My CMS is Dreamweaver. Take a look at the site. funkygames.co "Hover" over the navigation bar, you'll see it works. But once you click on a game the entire navigation bar stops working because it thinks its in the Game directory. – Hulio-G Dec 15 '15 at 2:02
  • BTW- I changed your domain name in the question trying to keep it from being put on hold for being about particular to one website. – closetnoc Dec 15 '15 at 2:03
1

Your links within your navigation are relative and not absolute. For example:

<div id="NavBar"><a href="index.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Home','','images/images/Nav_Over_01.gif',1)"><img src="images/Nav_Bar_01.gif" alt="Home" width="119" height="44" id="Home" /></a>

versus:

<div id="NavBar"><a href="/index.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Home','','images/images/Nav_Over_01.gif',1)"><img src="images/Nav_Bar_01.gif" alt="Home" width="119" height="44" id="Home" /></a>

...where I put a / before index.php. See if that helps.

  • I tried and tested that for 20 minutes but that had no effect. I mean I could just duplicate the entire navigation bar and make another copy in in /games/. But that just seems sloppy and roundabout. – Hulio-G Dec 15 '15 at 2:43
  • 1
    I just checked your site. You have the slash in the home page (good) but not in the /games/ page. Not sure how your site is set-up, however, your navigation should be the same for every page. I do not know Dreamweaver, but it seems like there is something to fix there or in how your site uses templates, includes, or something. The slash should work. You can view the source of your HTML in your browser. In Chrome, I used Inspect (right-click) to see the code. – closetnoc Dec 15 '15 at 2:55
  • Looks like i was uploading to the wrong directories. You are a genius! I would have never thought about "/".Never... Its so random and minor.... Programming is ridiculous...lol – Hulio-G Dec 15 '15 at 15:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.