Member
From: New York City
Registered: 2005-09-21
Posts: 71
I've been thanked 1 times.
Offline
I"m trying to accomplish the following:
all incoming traffic to my domain root -> www. domain root
all calls for index.htm -> www. domain root
all calls for POHome.htm -> www. domain root
-trying to get all the traffic to my www. address
-combining all traffic to index.html or POHome.html (which are identical) to the root domain (index.html)
I'm going to upload this text file and call it .htaccess :
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^XXX\.com
RewriteRule ^(.*)$ http://www.XXX.com/$1 [R=permanent,L]
RewriteRule ^index.htm$ http://www.XXX.com/ [R=301,L]
RewriteRule ^POHome.htm$ http://www.XXX.com/ [R=301,L]
-Does this look right? Obviously I'll put in my domain at the XXX is
-Is there any header stuff i need in this file or just put it up as is?
-is there any benefit to pointing all to the non-www. instead of the www. address? i had read on some forum that there was a push to get rid of the www. prefix, but from what I see, there doesn't seem to be much of a consensus on this.
I know there are a lot of posts on this but none seemed to meet my exact needs. Just want to make sure I'm not about to screw myself up.
P
Moderator
From: Yorkshire, UK
Registered: 2006-08-19
Posts: 2793
I've been thanked 77 times.
Offline
I've never tried to do more than one rewrite!
I use this to force the www.
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.xxxxx\.com [NC]
RewriteRule ^(.*)$ http://www.xxxxx.com/$1 [L,R=301]
</IfModule>
Not that I've tried it, but I expect you'd need 3 condtition-rule pairs.
You could also try
Member
From: Where U least expect me
Registered: 2006-07-12
Posts: 2474
I've been thanked 81 times.
Offline
North seems to have it... we use
Code:
# redirect all non-www traffic
RewriteCond %{HTTP_HOST} ^yoursite\.com$
RewriteRule ^.*$ http://www.yoursite.com%{REQUEST_URI} [R=permanent,L]
# Redirect aliases of home page to the root website
rewriteRule ^index\.(php|html|htm) http://www.yoursite.com/ [R=permanent,L]
Affordable SEO services| Custom Web site design | Learn SEO | SEO Blog| the SEO Search Engine
Member
From: New York City
Registered: 2005-09-21
Posts: 71
I've been thanked 1 times.
Offline
so I have a page called POhome.html that's identical to the index.html file. (don't ask why)
would I add another line to redirect that?
like:
Code:
rewriteRule ^POHome\.(php|html|htm) http://www.yoursite.com/ [R=permanent,L]
Member
From: Where U least expect me
Registered: 2006-07-12
Posts: 2474
I've been thanked 81 times.
Offline
Well you have the page extension so...
Code:
rewriteRule ^POhome.html http://www.yoursite.com/ [R=permanent,L]
Affordable SEO services| Custom Web site design | Learn SEO | SEO Blog| the SEO Search Engine
Member
From: New York City
Registered: 2005-09-21
Posts: 71
I've been thanked 1 times.
Offline
thanks i'll give it a try.
it' will be apparent immediately no? If something is wrong I can just delete the file I'm guessing.
P
Member
From: Where U least expect me
Registered: 2006-07-12
Posts: 2474
I've been thanked 81 times.
Offline
PeterP wrote:
thanks i'll give it a try.
it' will be apparent immediately no? If something is wrong I can just delete the file I'm guessing.
P
Yuppers.. eavery server is set up a little different and it can be some playin aorund ..so we shall see...
Affordable SEO services| Custom Web site design | Learn SEO | SEO Blog| the SEO Search Engine
Member
From: New York City
Registered: 2005-09-21
Posts: 71
I've been thanked 1 times.
Offline
All that and it won't let me upload the file.
.htaccess - error occurred - An FTP error occurred - cannot put .htaccess. Access Denied. The file may not exist, or there could be a permission problem.
File activity incomplete. 1 file(s) or folder(s) were not completed.
any ideas?
Member
From: Where U least expect me
Registered: 2006-07-12
Posts: 2474
I've been thanked 81 times.
Offline
yes
rename it to htaccess.txt ... a TEXT FILE.... then upload it.
Once uploaded, change the file name via FTP to .htaccess
Get it?
Affordable SEO services| Custom Web site design | Learn SEO | SEO Blog| the SEO Search Engine
Member
From: New York City
Registered: 2005-09-21
Posts: 71
I've been thanked 1 times.
Offline
never mind, i'm on yahoo, they don't allow it.
pricks.
guess i'm screwed til I move to a different host.
.htaccess (Hypertext Access)
The name .htaccess refers to the main configuration file for Apache, a popular open-source HTTP server. The .htaccess file can be used to create custom error pages and web page redirects, set up password protection, enable SSI, and more. Yahoo! does not currently allow you to upload .htaccess files to your account. For other customization options, we recommend the Custom Error Pages and password-protection features available in your Web Hosting Control Panel.
bummer, thanks for the help anyway.
Member
From: Where U least expect me
Registered: 2006-07-12
Posts: 2474
I've been thanked 81 times.
Offline
PeterP wrote:
never mind, i'm on yahoo, they don't allow it.
pricks.
guess i'm screwed til I move to a different host.
.htaccess (Hypertext Access)
The name .htaccess refers to the main configuration file for Apache, a popular open-source HTTP server. The .htaccess file can be used to create custom error pages and web page redirects, set up password protection, enable SSI, and more. Yahoo! does not currently allow you to upload .htaccess files to your account. For other customization options, we recommend the Custom Error Pages and password-protection features available in your Web Hosting Control Panel.
bummer, thanks for the help anyway.
Yeah I generally advise against such hosting for the obvious reasons.... when ya want some space cheap...come and see me I shall fix U up ... ( it's good to know da boss)
Affordable SEO services| Custom Web site design | Learn SEO | SEO Blog| the SEO Search Engine
| Never |


