Forum Moderators: phranque
What do I need to do? I would like to delete the files on my old subdir and redirect people to the new domain, can I delete? and how do I redirect? I have read about htaccess and 301 but I think I need the files there to do that. Also, if I leave the files in my old subdir, wont that cause problems because of duplicate sites with search engines? Does a re-write doing a redirect also tell search engines that this subdir is gone and go to the new place.
Its all functional now and I have submitted the new site so I need to worry about duplicate text on the sites (I just read about that here less than 2 minutes ago, so still not sure) and of course I don't want to kill my old site, just the subdir. There was only 11 HTML files in the subdir, the new domain will have about 20 so I was thinking of just doing redirect within the 11 HTML files, would that work?
Mike
Your set-up is not clear to me. Have you got a new directory or subdirectory on the same server, a new server, or is the only change that you want to make limited to changing the domain at which your files should be accessed?
Do you know if you can use mod_rewrite? Depending on your set-up, this may be critical to reaching your goal, but many low-cost/no-cost hosting services won't allow you to use it. This is because mod_rewrite is powerful and can be very complex, and it can raise their support costs dramatically. Before this thread turns techincal, it would be helpful to know what your options are.
Jim
old was www.mydomain.com/subdir/ physically was /home/html/mydomain/public_html/subir
now I have a domain for that site so it is
www.my_NEW_domain.com/ physically its /home/html/my_NEW_domain/public_html/
Basically, I had a domain with these people and I built a site in a subdirectory of that domain, I decided to get a second domain from them and would like to discontinue the old subdir and read here about duplicate content problems, and as a result, just want to redirect (permanently move) the old stuff. I should have access to rewrite as I can do .htacess in both site.
Not sure I am explaining myself correctly, sorry.
mod_rewrite sits right on the border between the URL-view and the filesystem view, which makes it both powerful and sometimes a bit difficult to grasp. Suffice it to say that a URL need have absolutely nothing in common with a filepath, and that is what makes URL-rewriting possible.
Assuming that all traffic is pointed to your top-level Web directory, then something like the following is what you need. It is not my intent to provide you with a complete solution, but rather to get you started. Valuable references can be found in our forum charter and in the WebmasterWorld library, in the Apache Server section.
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?old_domain\.com
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]
Jim
I will try this rewrite this evening. Thank You