Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

brianellisrules

macrumors regular
Original poster
Oct 17, 2003
229
0
well, it's probably not, but anyhoo....

my main site will be: http://www.brianellisrules.com/index.php

the code looks like this:
PHP:
<?php
include('/home2/brian/public_html/head.inc');
include('/home2/brian/public_html/greymatter/index.inc');
?>

greymatter/index.inc is the file automatically created by the blogger. usually it's a .htm file, but I changed it up during the conversion to php.

so, when my main page loads up, I get the title/menu across the top and the blogger as the main body. perfect.

however, the blogger has entries that can be commented and voted on. after voting, the blogger software does an automatic refresh by redirecting the browser to the main blogger directory (http://www.brianellisrules.com/greymatter/).

since the main blogger file has been renamed to /greymatter/index.inc I was getting a simple directory listing.

my work-around for this was putting a file in /greymatter/ called index.php (with code identical to that listed up top), so it would load automatically when the blogger/browser does the auto-refresh-redirect. low and behold, this actually works. I get the title/menus across the top and the blogger/news as the body.

now for the part that bugs me. after all this, the address bar of the browser now reads "http://www.brianellisrules.com/greymatter/", rather than just "http://www.brianellisrules.com". and like I said, it's rubbing me the wrong way.

is there a php command (or work-around) so that when the browser tries to load "http://www.brianellisrules.com/greymatter/index.php", it will automatically get redirected to "http://www.brianellisrules.com/index.php"?
 

brianellisrules

macrumors regular
Original poster
Oct 17, 2003
229
0
Ignore me because I'm a moron!





I just used a server side redirect to kick it back to the main page! I feel reallllly dumb.
 

groovebuster

macrumors 65816
Jan 22, 2002
1,249
101
3rd rock from the sun...
Set a variable in the script that calls greymatter/index.php and on there you make a redirect if the variable is true. Without knowing anything about your php-app this seems to be the easiest way without messing too much with the existing code.

groovebuster
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.