Website URL Permanent Redirect

New to mod_rewrite? This is a good place to start.

Website URL Permanent Redirect

Postby pgram » Fri Jan 16, 2004 3:44 pm

I tried to set the following up in both the .htaccess file and the httpd.conf file earlier without any success.

For some reason the .htaccess file does not appear to be working the way it should, especially if configured through the CPanel. The file appears to be set up correctly so I don't know what the problem is. The permission for the .htaccess file is set to 644, is this correct? The problem I am encountering is in having the system recognize "Redirect permanent (etc.)" commands in the file.

As a work around, I thought I would just add a command using apache's mod_rewrite in the httpd.conf file.

This what I need and what I have done (without much success):

I have an account on a server, highprobsell.com, that had 10 domain names pointed to it. Search engines have become fussy about this and some consider this spam. So I took one of the parked domains, radically-honest.com and unparked it and then set it up on the server with it's own account. I then took the other parked domains and unparked them from highprobsell.com and parked them on radically-honest.com.

Now what I want to do is use the mod_rewrite in the httpd.conf file to redirect all requests for radically-honest.com to highprobsell.com.

I rewrote radically-honest.com's Virtual Host directive to look like this:
<VirtualHost IP.#.here>
ServerAlias www.radically-honest.com radically-honest.com
ServerAdmin webmaster@radically-honest.com
DocumentRoot /home/radicall/public_html
BytesLog domlogs/radically-honest.com-bytes_log
ServerName www.radically-honest.com
ServerAlias training-sales.com www.training-sales.com
ServerAlias training-consulting.com www.training-consulting.com
ServerAlias sales-training-and-strategic-alliances.com www.sales-training-and-strategic-alliances.com
ServerAlias sales-and-marketing-discussion-board.com www.sales-and-marketing-discussion-board.com
ServerAlias radicallyhonest.com www.radicallyhonest.com
ServerAlias highprobsell.net www.highprobsell.net
ServerAlias highprobabilityselling.net www.highprobabilityselling.net
ServerAlias high-probability-selling.com www.high-probability-selling.com
CustomLog domlogs/radically-honest.com combined
ScriptAlias /cgi-bin/ /home/radicall/public_html/cgi-bin/
RewriteEngine ON
RewriteCond %{HTTP_HOST} ^(.+)\.radically-honest\.com
RewriteRule ^(.*) http://www.highprobsell.com/$1 [R=301,L]
</VirtualHost>

I also tried putting the following instruction in the .htaccess file, but it didn't work, so I suspect there is either a permission problem or some other problem which is not letting the browser access the file correctly (especially since the following PermanentRediret /index.html http://www.highprobsell.com/index.html does not work).
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} !^radically-honest\.com
RewriteRule (.*) http://highprobsell.com/$1 [R=permanent,L]

Any help or suggestions would be greatly appreciated.

Warm Regards,
Pam
pgram
 

Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 29 guests

cron