You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Rajasekaran Deepak <de...@students.iiit.net> on 2003/06/17 13:00:24 UTC

[users@httpd] Hiding file extensions using htaccess

I want to hide file extensions. My htaccess file contains:

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}\.shtml -f
    RewriteRule ^(.*)$              $1.shtml

But the above lines do not allow files to be accessed without
the ".shtml" extension. Could you tell me what the mistake in my
htaccess file is? A soft link to the whole htaccess file is at:

    http://students.iiit.net/~deepak_r/htaccess

Thanks in advance,
Rajasekaran Deepak

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Hiding file extensions using htaccess

Posted by Robert Andersson <ro...@profundis.nu>.
Rajasekaran Deepak wrote:
> The httpd.conf file appears to enable MultiViews.
> But I am not able to access files without their extensions.
> I am including /etc/httpd/conf/httpd.conf as an attachment.
> My home directory is /2k-2k1/deepak_r/ .
> Could you tell me where the error is?

No, I cannot see any glaring errors.

Typically, all you need to do to a vanilla Apache, is to add Options
MultiViews on some directory. Might have something to du with mod_userdir;
does it work on non-userdir directories?


Regards,
Robert Andersson


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Re: Hiding file extensions using htaccess

Posted by Rajasekaran Deepak <de...@students.iiit.net>.
* Joshua Slive 17-Jun-2003:
> On Tue, 17 Jun 2003, Rajasekaran Deepak wrote:
> > The httpd.conf file appears to enable MultiViews.
> > But I am not able to access files without their extensions.
> > I am including /etc/httpd/conf/httpd.conf as an attachment.
> > My home directory is /2k-2k1/deepak_r/ .
> 
> http://httpd.apache.org/docs-2.0/mod/mod_mime.html#multiviewsmatch

I commented out the rewrites and tried
"MultiviewsMatch Handlers Filters" and even
"MultiviewsMatch Any" in my htaccess file.
But I am still not able to access files
without their extensions.

* Robert Andersson 18-Jun-2003:
> Typically, all you need to do to a vanilla Apache, is to add Options
> MultiViews on some directory. Might have something to du with mod_userdir;
> does it work on non-userdir directories?

.html pages on non-userdir directories are also not
accessible without their extensions.

I had sent httpd.conf as an attachment with my previous mail.
I have read-only access to httpd.conf .
A soft link to the htaccess file is at:
    http://196.12.44.6/~deepak_r/htaccess

Thanks in advance,
Rajasekaran Deepak

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Hiding file extensions using htaccess

Posted by Joshua Slive <jo...@slive.ca>.
On Tue, 17 Jun 2003, Rajasekaran Deepak wrote:

> * Robert Andersson 17-Jun-2003:
> > http://httpd.apache.org/docs-2.0/content-negotiation.html
>
> The httpd.conf file appears to enable MultiViews.
> But I am not able to access files without their extensions.
> I am including /etc/httpd/conf/httpd.conf as an attachment.
> My home directory is /2k-2k1/deepak_r/ .
> Could you tell me where the error is?

See also:
http://httpd.apache.org/docs-2.0/mod/mod_mime.html#multiviewsmatch

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Re: Hiding file extensions using htaccess

Posted by Rajasekaran Deepak <de...@students.iiit.net>.
* Robert Andersson 17-Jun-2003:
> http://httpd.apache.org/docs-2.0/content-negotiation.html

The httpd.conf file appears to enable MultiViews.
But I am not able to access files without their extensions.
I am including /etc/httpd/conf/httpd.conf as an attachment.
My home directory is /2k-2k1/deepak_r/ .
Could you tell me where the error is?

Thanks in advance,
Rajasekaran Deepak

Re: [users@httpd] Hiding file extensions using htaccess

Posted by Robert Andersson <ro...@profundis.nu>.
Rajasekaran Deepak wrote:
> I want to hide file extensions.

I have a new friend for you... Content Negotiation!

Meet him (or her?) at:
http://httpd.apache.org/docs-2.0/content-negotiation.html


Regards,
Robert Andersson


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org