Help with "Wrap"

Using mod_rewrite to handle various content issues

Help with "Wrap"

Postby Gamer4u » Wed Sep 06, 2006 8:05 am

I'm trying to add an advertisment to the bottom of a webpage of a hosted websites. My problem is, that when a subdomain is used, the url that is used is http://SUB.servebyte.com/htmlfile.php4 when that doesn't exist and it is located at http://servebyte.com/htmlfile.php4 so it returns an error.

Any way to get around this, like absolute paths such as /home/USER/public_html/htmlfile.php4 WITHOUT having to put a copy of htmlfile.php4 in every directory which has a subdomain?

Code: Select all
AddHandler htmlfile .htm
AddHandler htmlfile .html
Action htmlfile /htmlfile.php4

AddHandler phpfile .php
Action phpfile /phpfile.php4
Gamer4u
 
Posts: 4
Joined: Wed Sep 06, 2006 8:00 am

Postby richardk » Wed Sep 06, 2006 9:22 am

How are you appending it to every page? Can't you include it using the URL instead of a physical path?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby Gamer4u » Wed Sep 06, 2006 11:03 am

ok, now i'm using the following code:
Code: Select all
AddHandler htmlfile .htm
AddHandler htmlfile .html
Action htmlfile http://www.servebyte.com/htmlfile.php4


http://www.servebyte.com/status.php
http://www.servebyte.com/hosting.php
WORKS GREAT!

but...
http://bbs.servebyte.com/ returns the error
Not Found
The requested URL /phpfile.php4/index.php was not found on this server.


Which was the orriginal problem
Gamer4u
 
Posts: 4
Joined: Wed Sep 06, 2006 8:00 am

Postby richardk » Wed Sep 06, 2006 11:51 am

You could put them in the /icons directory because it's an Alias and will be available from every subdomain.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby Gamer4u » Wed Sep 06, 2006 12:03 pm

> CWD icons
< 550 Can't change directory to icons: No such file or directory

shared server :(
Gamer4u
 
Posts: 4
Joined: Wed Sep 06, 2006 8:00 am

Postby richardk » Wed Sep 06, 2006 12:21 pm

You can oput this in a .htaccess file in each subdomain directory, but isn't it as bad as putting the real files in it?

Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^(php|html)file\.php4$ http://servebyte.com/$1file.php4 [R=301,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby Gamer4u » Wed Sep 06, 2006 12:32 pm

Thanks, i can try that. If anyone has a solution to this which invloves only one file, please reply :)
Gamer4u
 
Posts: 4
Joined: Wed Sep 06, 2006 8:00 am


Return to Content

Who is online

Users browsing this forum: Google [Bot] and 2 guests

cron