The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Web host uses URL rewriting by default
Christian J
post Nov 4 2015, 07:05 PM
Post #1


.
********

Group: WDG Moderators
Posts: 9,628
Joined: 10-August 06
Member No.: 7



A web host's Apache server uses some kind of URL rewriting, so that you can access a file like

CODE
foo.html

with just the URL

CODE
/foo

Is this a good idea? Can or should I try to remove it? It's not done in any .htaccess file that I can see, so I guess it's in some Apache .conf file. A quick web search just turns up pages on how to enable this, not how to disable it. unsure.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Nov 5 2015, 01:46 AM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



if it's a good idea for you to have I don't know. i think it's a bad idea for a web host to force anything on all users, more than essential things like file types. couldn't you just ask them to exclude you if you want to get rid of it?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Nov 5 2015, 08:58 AM
Post #3


.
********

Group: WDG Moderators
Posts: 9,628
Joined: 10-August 06
Member No.: 7



QUOTE(pandy @ Nov 5 2015, 07:46 AM) *

if it's a good idea for you to have I don't know.

Me neither. I wouldn't link to such URLs on purpose. Could there be any potential security implications, like XSS vulnerabilities?

QUOTE
i think it's a bad idea for a web host to force anything on all users

Actually I had no idea they were doing it, until I found out by mistake.

QUOTE
couldn't you just ask them to exclude you if you want to get rid of it?

Yes but first I must decide what I want. blink.gif

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Nov 5 2015, 12:38 PM
Post #4


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



Well, TBL advocates for leaving off the filename extension (as well as other things): Cool URIs don't change
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Nov 5 2015, 01:25 PM
Post #5


.
********

Group: WDG Moderators
Posts: 9,628
Joined: 10-August 06
Member No.: 7



QUOTE(Darin McGrew @ Nov 5 2015, 06:38 PM) *

Well, TBL advocates for leaving off the filename extension (as well as other things): Cool URIs don't change

Some good points about future-proofing. However, I still use .html extensions even when pages are generated by server-side scripts. I guess I could still use those .html extensions even if I stopped using HTML in the distant future.

Also this part sounds dangerous:

QUOTE
You keep the file extension (such as .png) on the file (e.g. mydog.png), but refer to the web resource without it. Apache then checks the directory for all files with that name and any extension, and it can also pick the best one out of a set (e.g. GIF and PNG).

According to my quick test, my Apache server picked a directory (redirecting "foo" to "foo/"). If that directory did not exist, an HTML file was picked.

When I deleted the directory "foo/", Apache still redirected the URL "foo" to "foo/", where it displayed the HTML file as if it was the directory index file. But if I create a new HTML file "bar.html", the URL "bar" does not redirect to "bar/". Maybe some kind of URL caching is going on there?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jan 8 2016, 04:13 AM
Post #6


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



QUOTE(Christian J @ Nov 5 2015, 07:25 PM) *

Also this part sounds dangerous:

QUOTE
You keep the file extension (such as .png) on the file (e.g. mydog.png), but refer to the web resource without it. Apache then checks the directory for all files with that name and any extension, and it can also pick the best one out of a set (e.g. GIF and PNG).

According to my quick test, my Apache server picked a directory (redirecting "foo" to "foo/"). If that directory did not exist, an HTML file was picked.

When I deleted the directory "foo/", Apache still redirected the URL "foo" to "foo/", where it displayed the HTML file as if it was the directory index file. But if I create a new HTML file "bar.html", the URL "bar" does not redirect to "bar/". Maybe some kind of URL caching is going on there?



Don't know. This is one of the reasons I don't use this. Too many things too keep track of. I suspect I would also need to abandon the way I rename backup files. I sometimes just change the case. Like index.HTML for the first backup and INDEX.HTML for the next if I want to keep two. They sort right with FTP and it makes them stand out, but I don't know if it would be safe.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th March 2024 - 03:22 AM