Jump to content

Archived

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

hp_solomon

session/login problem after mod_rewrite subdomains

Recommended Posts

 

I have a music website that offers free forum for registered bands, that is one forum category created for each band. To access the bands forum you need to go to the viewforum.php page passing the band id or the band name as a parameter. I modified the viewforum.php to display the forum either by forum id or forum name (band name - viewforum.php?f=bandname).

 

It will be easier and better for bands and members of the community if all bands have their own subdomain. So i created a script in .htaccess to mod_write the URL to create fake subdomains. Now http://bandname.domain.com accesses the page http://www.domain.com/viewforum.php?f=bandname without actually changing the URL in the address bar.

 

After i mod_rewrite to create fake subdomains i modified the viewforum template file to absolutely path the links and images so that it will work properly.

 

Now i got a new problem. When I logged in to the site and go to the page using a link or typing the URL of the fake subdomain (http://bandname.domain.com), my session dissapeared. Everytime I go to the page even I am logged in, I was logged out or not totally logged out because when i go back to the page without the subdomain, i was logged in again.

 

Seems like using the subdomain my session dissapeared but the session is there when i go back to the page without the subdomain.

 

Is there a way to maintain a single session to multiple subdomain, or is there a solution to fix this issue. Any advice.?

 

Here is the directory structure of the site when i access it through FTP:

bin

cgi-bin

conf

error_docs

etc

httpdocs ---> root folder of the site... and the root of phpbb

lib

pd

private

subdomains ---> empty, no folders and files

tmp

usr

var

web_user

 

 

I think the solution to this is to point all my subdomain to the directory root of my domain name. that is on /httpdocs/ directory.

 

How can i point all my subdomains to the root directory of my main subdomain?

 

 

Please help.

 

I hope someone can help me for I am trying to fix this for more than a week now. Thank you very much.

Share this post


Link to post
Share on other sites

×

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.