homepage Welcome to WebmasterWorld Guest from 54.211.180.175
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

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




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

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!

 

jdMorgan




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

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

xcomm




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

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

xcomm




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

Is there a chance to rewrite this too?

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

jdMorgan




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

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

xcomm




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

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?

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved