Forum Moderators: phranque
Thanks jd01 for your help.
I will try the 301 redirect If I'm able to, as I have nothing to lose.
Considering I have one index.html in the /mydir/ directory, and the non-slash url doesn't exist, I'm not sure where to place the redirect etc...maybe you could point me in the right direction?
[edited by: jdMorgan at 1:09 pm (utc) on May 19, 2005]
[edit reason] Linked to previous discussion. [/edit]
First, you should know a little about what is going on with mod_rewrite...
You can find that here: [webmasterworld.com...]
Then you can use this code, or something close, courtesy of jdMorgan, to redirect a non-slash request to a slash request:
RewriteCond %{REQUEST_URI}!^[^.]*/$
RewriteRule (.+) /$1/ [R=301,L]
Then, on the old, duplicate content domain, you can just redirect everything to the current domain:
Use this if you have exactly the same directories (folders) and files (pages) on the new domain as you did on the old one:
RewriteEngine on
RewriteRule (.*) http://www.newsite.com/$1 [R=301,L]
If the structure is different, use this:
RewriteEngine on
RewriteRule (.*) http://www.newsite.com/ [R=301,L]
Hope this helps... let us know if you have any more questions. My week has been (and may continue to be) fairly hectic, so I have not had time to post in this area as much as I would like - Have to think a lot in here - So, if I can't get back to you I am sure someone else will be able to help you out.
Please, keep in mind that these should go in a .htaccess file in the 'root' or 'main' directory of the respective sites. Also, know if you are uploading, you must create the file in plain text and upload as ASCII.
It is always a good idea to check your site for a current .htaccess file, by viewing 'invisible' files with your FTP client or shell account, so you don't overwrite anything already there... If you have one, you should be able to add these lines to it and be ready to go.
Justin