PDA

View Full Version : subdomain points to PHP file, but links don't work


personman
4-9-04, 01:25 PM
I'm running Postnuke, which includes a nice module for a mobile version of the site. I creaded a subdomain that points to the php file using .htaccess. It works fine:

mobile.adriancc.org

But click on a link for a story and it goes nowhere. How can I make this work? Would a redirect be better? (In other words, have the subdomain redirect to the php page)

BerksWebGuy
4-9-04, 01:39 PM
How are you redirecting your subdomain. If you using the new mapping system (making subdomain on the same level as htdocs, then giving it its own htdocs) then it will be looking for an index page.

If you are using .htaccess...then post the relevant contents here.

personman
4-9-04, 02:21 PM
htaccess:

RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} mobile.adriancc.org
RewriteCond %{REQUEST_URI} !modules.php?op=modload&name=AvantGo&file=index&meid=2
RewriteRule ^(.*)$ modules.php?op=modload&name=AvantGo&file=index&meid=2$1 [L]

BerksWebGuy
4-9-04, 02:25 PM
It works fine for me...I'm getting the same page whether I use the subdomain or not. Make sure you refresh your page.

personman
4-9-04, 02:26 PM
I think it would work better if the subdomain redirected browsers to the actual file, so that once you typed in 'mobile.adriancc.org' and hit enter, the address bar would say

http://www.adriancc.org/modules.php?op=modload&name=AvantGo&file=index&meid=2

instead of

http://mobile.adriancc.org/

If that were the case, then clicking on the first link would take you to

http://www.adriancc.org/print.php?sid=9

instead of

http://mobile.adriancc.org/print.php?sid=9

which doesn't exist.

But how do I do that?

BerksWebGuy
4-9-04, 02:28 PM
Try changing this line:

RewriteRule ^(.*)$ modules.php?op=modload&name=AvantGo&file=index&meid=2$1 [L]

to this:

RewriteRule ^(.*)$ modules.php?op=modload&name=AvantGo&file=index&meid=2$1 [R]

You're just changing the L to a R.

BerksWebGuy
4-9-04, 02:30 PM
If that doesn't work...leave the R...and redirect it to the full address:

RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} mobile.adriancc.org
RewriteCond %{REQUEST_URI} !http://www.adriancc.org/modules.php?op=modload&name=AvantGo&file=index&meid=2
RewriteRule ^(.*)$ http://www.adriancc.org/modules.php?op=modload&name=AvantGo&file=index&meid=2$1 [L]

personman
4-9-04, 05:03 PM
Thank you. I think your last suggestion did it. My .htaccess:

RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} mobile.adriancc.org
RewriteCond %{REQUEST_URI} !http://www.adriancc.org/modules.php?op=modload&name=AvantGo&file=index&meid=2
RewriteRule ^(.*)$ http://www.adriancc.org/modules.php?op=modload&name=AvantGo&file=index&meid=2$1 [L]

And it works just like I wanted it to:

mobile.adriancc.org (http://mobile.adriancc.org)

I messed with the letter in brackets at the end. It doesn't seem to affect anything, what is supposed to control?

Thanks again.

BerksWebGuy
4-9-04, 06:48 PM
Glad you got it going...and I don't know what the R and L does either :D