LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-22-2010, 09:45 AM   #1
tps565
LQ Newbie
 
Registered: Dec 2010
Posts: 4

Rep: Reputation: 0
Apache 1.3.42 - directory with dots...


Hi, I need your help how to solve this one:

httpd.conf:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^.*/$
RewriteCond %{REQUEST_URI} !^.*/[^/]+\.[^/]+$
RewriteRule ^(.*)$ $1/ [R]

https://servername/dir/ -- It works.
https://servername/file.html -- It works.
https://servername/dir.2.0/ -- not work.

Yes, dir.2.0 is directory. I wasn't sure how to write in httpd.conf.

I appreciate your help.

Last edited by tps565; 12-22-2010 at 09:46 AM.
 
Old 12-22-2010, 12:48 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi and welcome to LQ,

Can you give more details about what you're trying to accomplish.
Maybe using a "/" in the rule should do, because without it the URL: https://servername/dir (without the trailing slash) doesn't work.
Code:
RewriteRule ^(.*)/$ $1/ [R]
 
Old 12-23-2010, 05:55 AM   #3
tps565
LQ Newbie
 
Registered: Dec 2010
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
Hi and welcome to LQ,

Can you give more details about what you're trying to accomplish.
Maybe using a "/" in the rule should do, because without it the URL: https://servername/dir (without the trailing slash) doesn't work.
Code:
RewriteRule ^(.*)/$ $1/ [R]
Thank you...

I am glad you asked me... I understand about RewriteRule what you suggest but not what I mean... You know the directory name is 'dir.2.0' and you see RewriteCond that will remove the slash because it thought 'dir.2.0' is file.
I did try like this:

https://servername/dir.2.0/ then apache removed end of character '/' because of RewriteCond like this:

https://servername/dir.2.0 then not found.

Hope it clears to you...
 
Old 12-23-2010, 08:19 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Doh, I still don't get it. Do you want to remove the trailing slash from directories and still to work?
If that's what you want, then use:
Code:
DirectorySlash Off
in httpd.conf.
Just keep in mind the consequences doing so
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Trailing slash problem in apache... or DNS? Swakoo Linux - Newbie 1 06-07-2005 10:20 PM
Apache trailing slash boondock_saint Linux - General 9 07-07-2004 03:31 PM
Apache trailing slash puzzler tantric Linux - Software 4 04-11-2004 04:18 PM
Necessary trailing slash in apache directories silversky Linux - Software 3 03-03-2004 03:19 AM
apache slash / Question eyewittness Linux - Networking 6 01-22-2004 05:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration