Jump to content

[SOLVED] Display HTML Code if URL = ""


luke777

Recommended Posts

:(

 

Just got the error message : "Error"

 

Its a pretty complex game site script and which is probably whats causing the problems....

 

I tryed placing it in index.php as you suggested instead of game.php but i dont think it makes any difference because afterall game.php is displayed inside index.php if you know what i mean....

in your .htaccess file change this:

RewriteEngine on 
RewriteCond %{HTTP_HOST} ^monstergamez.net [NC] 
RewriteRule ^(.*)$ http://www.monstergamez.net/$1 [L,R=301]

RewriteEngine on
RewriteRule ^(.*)\.html$ index.php?params=$1 [L]

Redirect 301 http://monstergamez.net http://www.monstergamez.net

 

to this:

RewriteEngine on 
RewriteCond %{HTTP_HOST} ^monstergamez.net [NC] 
RewriteRule ^(.*)$ http://www.monstergamez.net/$1 [L,R=301]

#RewriteEngine on
#RewriteRule ^(.*)\.html$ index.php?params=$1 [L]

Redirect 301 http://monstergamez.net http://www.monstergamez.net

then click on a game and see what it says in the url address bar

Luke, when you tried my piece of code, before you edited the .htacess file given by Dragen, which game were you on?

 

If you were not on Nightmare House or Bat In Nightmare it would have displayed "Error!".

 

Just checking this first before you move on to other suggestions...

 

Chris.

try this:

<?php

$URL = "http://www.monstergamez.net/".$_GET['params']."";
$URL = rtrim($URL, "/") . ".html";

switch($URL) {
case 'http://www.monstergamez.net/game/991/Nightmare-House.html': //If this URL is in the browser...
echo '<b>Put your ad for the game "Nightmare House" here...</b>'; // ... Display this HTML.
break;

case 'http://www.monstergamez.net/game/9999398/Bat-In-Nightmare.html': //If this URL is in the browser...
echo '<b>Put your ad for the game "Bat In Nightmare" here...</b>'; // ... Display this HTML.
break;

default:
echo 'Error!';
}

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.