PDA

View Full Version : PHP forum, Use Portal.php instead of Index.php



cwpippin
12-11-2004, 02:00 AM
I am attempting to make a subdomain use portal.php as its default web document instead of login.php.

I have created a .htaccess file in the subdomains directory, the root of the phpbb installation, and it is not working. I modified the httpd.conf file and added portal.php in its DirectoryIndex section as the first entry. I then rebooted my virtual server and all web activity was dead. I SSH'd into my site and renamed the original file back to the correct name and again rebooted and all came back.

However I am still unable to force this subdomain to use the portal.php as its main, starting website without doing a redirect via an index.htm file.

Any ideas? Careful.. I am somewhat a linux noob.

Thanks in advance!

wildjokerdesign
12-11-2004, 06:45 AM
I just did a test and I was able to change default index page for a directory using a .htaccess file. It looks like this:

DirectoryIndex font.php

I decided to make sure it would not also look for an index.html page so uploaded one and it still looked for the font.php page.

You might double check the name of your .htaccess file. Make sure to upload in Ascii mode. Not sure if that matters but was how I uploaded it. It may be the text editor you are using to create the file since you also had a problem with modifying your httpd.conf file.

Is your PhpBB directory at /var/www/html/PhpBB or have you created it outside your default web root?

Double check spelling and such on things. You mentioned in your post makeing it look for portal.php instead of login.php but login.php is not a default index for directories. Did you mean index.php?

Hope that helps. Feel free to ask for clarification on any of my rambleings. :)

torrin
12-11-2004, 08:21 AM
You can create an .htaccess file with a redirect in it.


redirect /index.html http://www.mydomain.com/portal.php

Of course you'll have to change to paths.

cwpippin
12-11-2004, 12:56 PM
Is your PhpBB directory at /var/www/html/PhpBB or have you created it outside your default web root?


I have the Westhost provided install of phpbb in the /var/www/html/phpBB2 location but this instance is in a seperate directory. It runs with the exception of the portal.php.



Double check spelling and such on things. You mentioned in your post makeing it look for portal.php instead of login.php but login.php is not a default index for directories. Did you mean index.php?


Yes.. It appears after looking through the code that index.php is called.

Great Ideas and I will look closer.

cwpippin
12-11-2004, 02:46 PM
You can create an .htaccess file with a redirect in it.


redirect /index.html http://www.mydomain.com/portal.php

Of course you'll have to change to paths.

Tried that, it did not work. Its like my .htaccess file is not being read when the subdomain is accessed.

cwpippin
12-11-2004, 02:51 PM
Ok.. I still can not get this to function. I have deleted my .htaccess file and ssh'd into my domain. I used pico to create a new .htaccess file with the redirect syntax that torrin suggested. No luck.

As I stated in my previous message. Its like the .htaccess file is not being read. It is located in the directory of the subdomain. Does it need to be located somewhere else?

I am not a complete noob to running this as this was and still is a working config on a web server @ my home that was access using dyndns.org.

Thanks for all of you help.

cwpippin
12-11-2004, 03:15 PM
Found the issue...

I had the path set to this subdomain as /www/htdocs/the_name_of_the_subdomain. The /www/htdocs was the default path that the subdomain and the parent domain both defaulted to. It seemed fine and appeared to work fine. Many ways to get to the same location with symlinks.

However.. for some reason that was the issue. I changed the path to /var/www/html/the_name_of_the_subdomain and all worked. Now my .htaccess file is being read and adhered to.

Thanks to all for the help.