Forum Moderators: phranque

Message Too Old, No Replies

CGI Page to Subdomain

Problems converting .pl page to subdomain

         

venice

9:43 pm on Apr 20, 2007 (gmt 0)

10+ Year Member



I thought this would be fairly easy but I appear to be missing some steps in getting a rewrite to work properly.

I have a .pl page that creates a directory index...
[mysite.com...]

I'm trying to rewrite it to appear like this...
[subdomain.subdomain.mysite.com...]

Here is what I have...

rewriteCond %{HTTP_HOST} ^www.mysite.com/cgi-bin/tree/NM_123\.pl
rewriteRule (.*) [subdomain.subdomain.mysite.com...] [R=301,L]

I added that to .htaccess but it's not working.
Are there different rules for files inside cgi-bin?

jdMorgan

11:32 pm on Apr 20, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I believe your rewrite rule is completely backwards. You need to link to the subdomain, and rewrite from there to the 'real' .pl file's location.

Start here [webmasterworld.com].

For more information, see the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].

Jim