Jump to content
nolen1

Can I Use Mod_rewrite Here?

Recommended Posts

Hello,

 

Are domains found by using this http://domain.com and http://www.domain.com.

 

Will I be aloud to use mod_rewrite? And will this work in my .htaccess file to redirect http://www.domain.com to http://domain.com?

 

Options +FollowSymLinks

RewriteEngine on

RewriteCond %{HTTP_HOST}!^domain\.com

RewriteRule (.*) http://domain.com/$1 [R=permanent,L]

 

I'm having a problem with three of my sites. I was doing good in Google until my listings switched from http://**** to *****. Most of the incoming links are pointing to http://**** without www. so my I have went from top five for my keywords to numbers like eighty eight. I From what I've read I guess this happened because other sites linked to mine the two different ways. I didn't know it mattered both urls go to my site.

I read about several people that added a 301 redirect like this

 

Options +FollowSymLinks

RewriteEngine on

RewriteCond %{HTTP_HOST}!^domain\.com

RewriteRule (.*) http://domain.com/$1 [R=permanent,L]

 

to their .htaccess file and Google merged the two urls and they keep their page rank and incoming links. I tried to add many versions that I have found and they won't work. I works when I redirect permenant to another page or domain using something like this

 

redirect permanent / http://www.anydomain.com/

 

but I can't use mod_rewrite.

 

My hosting company said that mod_rewrite is enabled but that they tried several versions of mod_rewrite their self and they couldn't get it to work either they said it must not be compatible with their server. They said that they couldn't make a 301 redirect for me because it may affect other people's accounts. I'm afraid that Google's going to penalize me for having duplicate content since they consider with www. and without two different urls.

 

Thank you,

Karen

Share this post


Link to post
Share on other sites

Karen,

 

I do not know about the rest but my site works with and without the www. I believe the CName records are set up to point so your www subdomain points to the IP address your account is hosted on. The non www domain = the IP when your account is created. You shouldnt have to use mod_rewrite.

Share this post


Link to post
Share on other sites

Hi,

 

We do support mod_rewrite on all our servers.

 

I think your spinning your wheels on this one however.

 

Any site hosted here will work with or with the www extension.

 

However, several people are using mod_rewrite to do other things, so you should have no issues.

 

Bill

Share this post


Link to post
Share on other sites

Speaking about mod_rewrite I seem to be having a problem with my mod_rewrite. This is for the dynamic templating in MT. I have

 

><IfModule mod_rewrite.c>
 <IfModule mod_dir.c>
   DirectoryIndex index.php index.html index.htm default.htm default.html default.asp /mtview.php
 </IfModule>
  RewriteEngine on
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^(.*)$ /mtview.php [L,QSA]
</IfModule>

 

that basically says server the mtview.php file is the request isn't for a real directory or file. However this isn't working correctly. If the file physically exists but is erroring out (eg 500 premature end of script errors) mtview.php is being served. This makes troubleshooting problems very difficult because the mtview.php file is being served and I can't trace the error from the browser side nor that error log.

 

Any ideas ?

Share this post


Link to post
Share on other sites

mod_rewrite is supported. I also rewrite all URL's to the non-www address. I'm sure Google allows for links with & without the www.

 

I used these rules from http://no-www.org

 

>  RewriteEngine On
  RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
  RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]

Share this post


Link to post
Share on other sites

:dance: Welcome to the Family Karen and Amiya :)

 

and your new home!

 

We really are like family here.

So if you need anything,

just ask your new family!

We love to help :D

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...