Forum Moderators: phranque

Message Too Old, No Replies

htacess rewrite www.domain.name to www.domain.name/

www.domain.com add slash rewrite

         

igorberger

8:34 am on Jul 12, 2007 (gmt 0)

10+ Year Member



Probably has something to do with this, so not to go into the infinite loop

rewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/
rewriteRule ^index\.html$ http://www.example.com/ [R=301,L]

This works for index.html

but I need to rewrite www.domain.com to www.domain.com/

Thank you,
Igor

igorberger

3:20 pm on Jul 12, 2007 (gmt 0)

10+ Year Member



Tried working with the above method but get a loop.

jd is this the Wholly Grail?

jdMorgan

3:46 pm on Jul 12, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If your server is properly configured, then mod_dir should automatically append a missing slash to any (sub)directory request.

Something is not right, because an attempt to request "www.example.com" from your server isn't actually possible -- the request would be malformed on arrival. A normal browser request for this URL would look like this:

GET / HTTP/1.1
Host: www.example.com

and only a badly-written script or a broken browser would try to send a request like this:
GET HTTP/1.1
Host: www.example.com
(no slash, one or two spaces after "GET")

Look for some other mod_rewrite or mod_alias code that may be removing the slash.

Jim

igorberger

3:54 pm on Jul 12, 2007 (gmt 0)

10+ Year Member



My responce code is GET / HTTP/1.1

In IE 6.1 www.example.com is not returned with a slash
But in FF it does...

Is this IE bug and I should not worry about it?

jdMorgan

4:04 pm on Jul 12, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't understand what you wrote.

"GET /" is not a response code, it is a client request header.

It may be that IE6 fixes-up the slashless-URL request before sending it to your server (as it should) but does not show the fixed-up URL in its address bar, whereas Firefox fixes up the slashless request before transmission and does display the fixed-up URL in its address bar. IE7 appears to show the fixed-up request URL as well.

If you want to see the HTTP requests and responses to/from your server, try the "Live HTTP Headers" extension for Mozilla browsers. It's a great tool.

Jim

igorberger

4:18 pm on Jul 12, 2007 (gmt 0)

10+ Year Member



Sorry jd, I meant request header GET / HTTP/1.1

Okay so looks like no problem..

I am a bit conserned about G&A&M

Had a few exploit attacks on my domains already..

I am makings sure there is no posibility of canonical duplication for all cases...

I even give 404s to improbable query strings...

We don't want the nasty proxies on our backs.

<__>

Thanx for your help.
Igor

igorberger

4:35 pm on Jul 12, 2007 (gmt 0)

10+ Year Member



jd I use this online tool to check headers

www dot seoconsultants dot com/tools/headers/

What is good about this tool it also displays the the 200 OK page
in a browser simulator.

Which is important for SE. If you are using a 301 redirect and get 200 OK but the page is not displayed in the browser simulator, it will give you an error.

So if the page is not displayed in browser simulator then GYM will not index it properly and will not be able to follow the anchor links.

igorberger

6:39 am on Jul 15, 2007 (gmt 0)

10+ Year Member



JD you are great the index.php to folder rewrite is a real gold find...

Just in time the proxies were on my tail...

I lured a few in and then set the patch..

JdMorgan of the Web is like JpMorgan of the Wall...

Come check out my project PHSDL