PDA

View Full Version : help needed how to redirect



MJBwebpro
10-11-2005, 09:58 PM
hey all newbie here

I want people to be redirected to my miva store from my main domain name

how do i do this thanks all in advance

rispku
10-13-2005, 06:43 PM
There are several ways of doing this, but the best way to do it is with an htaccess file.

Placing the following rule in an .htaccess file, in your document root (/var/www/html), will effectively redirect anyone requesting an "index file" in any of your directories.



DirectoryIndex index.html index.htm index.php /Merchant2/merchant.mvc


Red = you may need to change this

It's important to list all of the index file-names and/or extensions you plan on using in other areas of your site! This rule is recurssive; it will apply to all of the sub-directories in your document root.

Another way of doing it is with PHP's header function. You can place the following code in an index.php file in your document root, and have it redirect the visitor to Merchant's URL on your site.



<?php
header("Location: http://www.yourdomain.com/Merchant2/merchant.mvc", true, 301);
exit;
?>


HTH

Justino Mora, Recruiter
04-01-2006, 01:56 PM
It is correct to used a .htacces to make Joomla behaves as if it were at main domain:
DirectoryIndex index.html index.htm index.php /joomla/index.php


I spent several hours, trying to make it work and I did not realized that after the /joomla I had to used the index.php

I just created my
DirectoryIndex index.html index.htm index.php /joomla/index.php

in a text file, uploaded through the file manager as htacces.txt file and then renamed as .htaccess file, BUT THE FILE DISSAPEARED. So I had to look it trough a FTP software, and there it was.

I added the /index.php to the
DirectoryIndex index.html index.htm index.php /joomla
and Joomla came alive when I typed my main domain.

Thank You for your tip. I am making this note, to help others avoid my own mistakes in following instructions.

lclark
03-17-2007, 07:14 PM
It is correct to used a .htacces to make Joomla behaves as if it were at main domain:
DirectoryIndex index.html index.htm index.php /joomla/index.php


I spent several hours, trying to make it work and I did not realized that after the /joomla I had to used the index.php

I just created my
DirectoryIndex index.html index.htm index.php /joomla/index.php

in a text file, uploaded through the file manager as htacces.txt file and then renamed as .htaccess file, BUT THE FILE DISSAPEARED. So I had to look it trough a FTP software, and there it was.

I added the /index.php to the
DirectoryIndex index.html index.htm index.php /joomla
and Joomla came alive when I typed my main domain.

Thank You for your tip. I am making this note, to help others avoid my own mistakes in following instructions.


i dont see the DirectoryIndex index.html index.htm index.php etc in my htaccess file?

do i need to put that in? if so , where ?

thanks

Lisa


is there a specific place in the htaccess file i shoud put this?

thanks
lisa

skimber
06-20-2009, 12:48 PM
i dont see the DirectoryIndex index.html index.htm index.php etc in my htaccess file?

do i need to put that in? if so , where ?

thanks

Lisa


is there a specific place in the htaccess file i shoud put this?

thanks
lisa

You just need to put it in your .htaccess file. It can go anywhere in the file as long as it isn't in the middle of another line of code.