PDA

View Full Version : htaccess code



reis
01-04-2007, 06:08 PM
i have a problem like this

i have an forum www.mydomain.com/forum but when you type www.mydomain.com you can see all my folders and files i edited the .htacces file like this


Options All -Indexes

redirect /index.php http://www.mydomain.com/forum

that whas the solution till when i make another domain as addon domain when i click the url on addon domain thats redirects me to root domain to


http://www.mydomain.com/forum

what should i type or how to manage the script need help i googled and no find

areidmtm
01-04-2007, 06:39 PM
just put a an index.php file in the root folder with this in it



<?php
header('location:/forum/');
?>
;

Don't mess with doing that with htaccess.

Schelly
01-04-2007, 06:43 PM
You could use a little snippet of javascript to redirect any traffic that comes to the root of your domain over to the /forum directory... something like this:



<html>
<head>
<title>Redirect Example</title>
<META NAME="revisit" CONTENT="12 days">
<meta NAME="Robot" CONTENT="allow">
</head>
<body>
<script language="javascript">window.location="http://www.yourdomain.com/forum/";</script>
Click <a href="http://www.yourdomain.com/forum/">here</a> to enter site<br>
</body>
</html>


Or you could use the redirect function in the control panel of your BH account. Or you could set .htaccess not to show directory contents if there is no index file.



IndexIgnore *


Lots of things you can do. I personally prefer a combination of the .htaccess no-index protection (it protects all directories under the current one) and the javascript file. But that's just me.

:)

reis
01-06-2007, 03:46 PM
i appreciate the work all codes are working but what with the addon domain with different url link

i have one as nurdiam.info when i click on it its redirects me to the another link on the same place to the forum how can i fix it i cant find anything