View Full Version : redirect addon domain
christian
09-12-2006, 11:27 AM
I am having troubles with redirecting for my addon domain.
For my addon domain I would like to set a cgi script as the first page - this is for a picture album software.
I tried the redirect:
www.addondomain.com --> redirect to www.addondomain.com/cgi-bin/pro/emAlbum.cgi
But it doesn't work.
If I remove the redirect, then the long URL works just fine.
How can I do this redirect ?
Thanks
Christian
Reichling
09-12-2006, 01:52 PM
Wouldn't a .htaccess redirect work here?
RewriteEngine ON
RewriteCond %{HTTP_HOST} ^addondomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.addondomain.com$
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^(.*)$ http://www.addondomain.com/cgi-bin/pro/emAlbum.cgi [R=301,L]
christian
09-12-2006, 01:56 PM
Let me try this. I don't really know how to use these.
I guess I'll put this in the folder for the addon domain ?
Reichling
09-12-2006, 02:01 PM
Inside your root folder should be a file called .htaccess. Add this code to it. (but backup the old file) If you start getting error 500 messages when you try going to your sites you did something wrong and replace it with the old file and try again.
christian
09-12-2006, 02:14 PM
I get a Page not found error 404
as extra info I tried to place the htaccess file in both the root of the main domain and the root of the subdomain.
I can still access the cgi script if I give the full path.
Reichling
09-12-2006, 02:22 PM
Hmm. Sounds like you input the target URL wrong. Make sure there is a space before and after http://www.addondomain.com/cgi-bin/pro/emAlbum.cgi Also I just realized I missed something in that code. Make sure you put http:// in front of http://www.addondomain.com/cgi-bin/pro/emAlbum.cgi.
(I edited the code above to fix that)
christian
09-12-2006, 02:31 PM
Hmm. Sounds like you input the target URL wrong. Make sure there is a space before and after http://www.addondomain.com/cgi-bin/pro/emAlbum.cgi Also I just realized I missed something in that code. Make sure you put http:// in front of http://www.addondomain.com/cgi-bin/pro/emAlbum.cgi.
(I edited the code above to fix that)
Thanks that was the problem:
"http://"
now one more question, anyway I can avoid to have the whole link in the URL
I mean seeing only "www.addondomain.com"
instead of "http://www.addondomain.com/cgi-bin/pro/emAlbum.cgi"
If not, no big deal.
Thanks
Reichling
09-12-2006, 02:40 PM
Well Im not sure if this will work with .cgi or with what exactly you are trying to do but you can give it a try. With notepad save this code as index.php in your root folder for that addon domain and try going to it directly addondomain.com/index.php (if you try going to it with addondomain.com the .htaccess redirect will redirect you.) But once you remove the .htaccess (only remove it if this code works) it will go to index.php
<?
include "http://www.addondomain.com/cgi-bin/pro/emAlbum.cgi";
?>
vBulletin® v3.7.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.