Page 1 of 1

Clean Urls [SOLVED]

Posted: Tue Aug 05, 2008 10:13 pm
by -null-
I have the following code in my .htaccess file to make all urls end in a slash however google keeps warning me about the 301 redirect.

Code: Select all

# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]
Is there a way to rewrite the URL without the redirect.  I tried taking the R=301 out as I thought that would work however it doesn't seem to.

Re: Clean Urls

Posted: Wed Aug 06, 2008 3:38 am
by Dr.CSS
This / means it has more like it's a folder with something in it so google is looking for and not finding the folder, so why would you want all URLs to end like that, do you see any other site doing it?...

Re: Clean Urls

Posted: Wed Aug 06, 2008 1:23 pm
by -null-
I'm pretty sure I've seen a few although can't think of any off the top of my head  ???

And really I just think having a trailing slash is tidier.

Re: Clean Urls

Posted: Wed Aug 06, 2008 6:41 pm
by Pierre M.
I don't understand why some people want trailing slashes. Why do they want leaves show as nodes ? Why don't they like /some/path/to/page.html ? I'm a last century web old timer, you know :-)

Pierre M.

Re: Clean Urls

Posted: Wed Aug 06, 2008 7:36 pm
by Dr.CSS
Having / at the end should make all browsers give an error 404 not found...

Re: Clean Urls

Posted: Thu Aug 07, 2008 5:31 pm
by -null-
Why is it so bad to want trailing slashes  If the file has an extension (html,aspx,php) then I don't mind leaving it like that but generally with clean urls without an extension I prefer a slash

Anyway I've decided just to leave it as is.  Its not important just aesthetics.