Welcome to WebmasterWorld Guest from 54.144.243.34

Forum Moderators: Ocean10000 & incrediBILL & phranque

http://www.domain.com to http://domain.com

   
10:54 am on Feb 14, 2005 (gmt 0)

10+ Year Member



Sorry just think this was wrote here some times but could not find it yet.

My site is used to [domain.com...] without www, but now some [domain.com...] poping up in the logs.

How to redirect or rewrite this?

Thanks!

4:26 pm on Feb 14, 2005 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



xcomm,

You're probably looking for a thread like this one: [webmasterworld.com...]

In order to use that code, mod_rewrite must be configured on your server.

Jim

8:27 pm on Feb 14, 2005 (gmt 0)

10+ Year Member



jdMorgan,

You are a legend!


RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.domain\.com
RewriteRule ^(.*) [domain.com$1...] [L,R=301]

(I left the / before the $1 off as otherwise I had [domain.com...]

Thanks, Jan

8:55 pm on Feb 14, 2005 (gmt 0)

10+ Year Member



Is there a chance to rewrite this too?

/http://domain.com/ to [domain.com...]

9:03 pm on Feb 14, 2005 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Regarding the double slash... Be aware that most of the code posted here is for use in .htaccess. There is a subtle difference between code for .htaccess and httpd.conf; In .htaccess, the local URL-path "seen" by RewriteRule is stripped of the leading slash. So, if you use code intended for .htaccess in httpd.conf, you will often get the double-slash problem.

I don't understand your second question. The "http://" is not part of the URL, it's part of the scheme, so I don't know where/how you would get "/http://"
(?)

Jim

9:16 pm on Feb 14, 2005 (gmt 0)

10+ Year Member



jdMorgan,

don't know where/how you would get "/http://"
(?)

I'm getting some wrong GETs this days from Slurp.
[webmasterworld.com...]
Yahoo did me kindly offer to check it.

But I think its coming from someones wrong URL linking to me. So it would be really cool to simply get rid of the slash before the http for such wrong requests.

Do you see any way?

 

Featured Threads

Hot Threads This Week

Hot Threads This Month