Jump to content

Phpnuke, Subdomains, And Admin.php

Recommended Posts

Hello there. I wish to have a subdomain that takes users directly to a phpnuke site.


So, I have set up the subdomain and the phpnuke stuff using CPanel. Everything pretty much works as I want it:


csa163.krumpe.com takes users to the phpnuke start page.

Even csa163.krumpe.com/index.php would take users to the phpnuke start page.


However, when I try to go to the admin page, I would LIKE to be able to get there by typing csa163.krumpe.com/admin.php But, when I do, I get an "Access is denied" message from the admin script. However, when I go to the admin page by entering krumpe.com/csa163/admin.php, there is no problem.


In other words, either way, I am able to get to the admin.php script, but somehow that script doesn't like it when I try to get there via my subdomain name.


Does anyone have any experience with this? Is this something that needs to be modified in phpnuke?


Thanks for your help.

Link to post
Share on other sites

I dont know it that well but what adress is in the configuration file for the ' LIVE' directory of phpnuke.

When it is www.domain.com/subdir then a rotuing from subdir.domain.com might not work ?!


Maybe you can look inti that and play with it and see what happens?


And more hopefully someone comes along who has actual experience with it..... :)


Good luck!

Link to post
Share on other sites

I've tried it both ways. The TCH CPanel script for installing phpnuke doesn't work with a preexisting directory. I've started from scratch a couple times, uninstalling and reinstalling both phpnuke and the subdomain in different orders. I've even installed phpnuke into a folder named csa163, renamed the folder, created the csa163 subdomain, and then moved all of phpnuke into the subdomain folder. It always gives the same results.


I've poked around a little in the admin.php file, and found that this is the check that's causing a problem:


>if ($_SERVER['SERVER_NAME'] != $domainname AND $_SERVER['SERVER_NAME'] != "localhost") {
 echo "Access denied";


It turns out that the value of $_SERVER['SERVER_NAME'] is my subdomain name, csa163.krumpe.com, but that the value of $domainname is www.krumpe.com.


So, I looked a little further...in phpnuke's config.php, $domainname is set to www.krumpe.com. I thought that my problem might be solved by changing that to csa163.krumpe.com. That DID fix the problem...I could now use csa163.krumpe.com/admin.php...but it created some new problems. In particular, I noticed that the "security code" feature of phpnuke stopped working correctly after changing the value of $domainname.


So, I'm at a loss over something that really is a pretty minor thing. I just thought I'd run it by people here because it seems like something someone might have come across before.


Thanks for your help.


Norm Krumpe

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...