htaccess

deuscypher

Junior Member
Joined
Jun 8, 2009
Messages
109
Reaction score
16
Hello,

I have a problem getting htaccess to work.

I had this

Code:
redirect / www.myaffiliatelink.com
I saved that as .htaccess.txt and put that in one of my addon domains on public_html. I put it in my domain's folder and the cgi-bin. Nothing really happens. I thought the code didn't make any sense to me. I already redirected my link on cpanel. I just want to cloak/blank my link.

I saw inside /public_html/mydomain.com<---(Addon domain) that had a .htaccess file, and the code looked something like this

Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^mydomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.mydomain.com$
RewriteRule ^/?$ "My affiliate link" [R=301,L]
I searched the forum and saw alot of variations on this but it all seem to be different.

If i had to change the code, would i change the .htaccess.txt or .htaccess on /public_html/mydomain.com
 
Hmmmmmmmmmm, the file needs to be called .htaccess - not .htaccess.txt

Now if you just want to redirect the entire domain your .htaccess contents should be:

Code:
Redirect 301 / http://www.linktoredirectto.com/
 
of course your provider has to enable the required server modules. mod_rewrite for example. and then it need to be allowed in the virtualhost container: AllowOverride FileInfo
 
Back
Top