?
Solved

htaccess file tweak. Help needed to give access to a application

Posted on 2006-11-18
14
Medium Priority
?
196 Views
Last Modified: 2010-04-11
Hi experts

I cannot access a file / application due to the .htaccess restricting access. I get the following error. it redirects to my 404 error page.

when i disable the the .htaccess by making it a text file the application works. My question is what do i add to the .htaccess file to get the application to work.

here is the current .htaccess file settings
*******************************************
Options +FollowSymlinks
RewriteEngine On
RewriteRule   ^manage(.*)$      -      [L]
RewriteRule   ^batch(.*)$      -      [L]
RewriteRule   ^export(.*)$      -      [L]
RewriteRule   ^templates(.*)$      -      [L]
RewriteRule   ^favicon\.ico(.*)$      -      [L]
RewriteRule      ^robots\.txt$ - [L]
RewriteRule      ^plain\.php$ - [L]
RewriteRule      ^(.*)$      index.php      [L]

*******************************************
i need to access all the files with in the following 'CB' folder on my server: /public_html/cb/

Thanks experts.

mdc

0
Comment
Question by:matthewdacruz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 4
14 Comments
 
LVL 14

Assisted Solution

by:yessirnosir
yessirnosir earned 1000 total points
ID: 17973971
I'm no expert on this, having only done this a few times under duress!  But in my case I had to add a RewriteBase directive to match up my server's physical file paths with the URL, i.e. the   "public_html" folder is what I see on my server, but it becomes the root directory to external clients, so I needed to add this line:
RewriteBase /
right after "rewriteEngine On" to tell the server essentially that the public_html directory is the root directory.  Without the RewriteBase / command, I got 404 errors too.

0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 1000 total points
ID: 17975671
>  i need to access all the files with in the following 'CB' folder on my server: /public_html/cb/
add follwoing after RewriteEngine line:

RewriteCond %{REQUEST_URI}  !^[/]*cb/
0
 

Author Comment

by:matthewdacruz
ID: 17975708
Thanks Dude!

That fixed the problem...


MDC
0
When ransomware hits your clients, what do you do?

MSPs: Endpoint security isn’t enough to prevent ransomware.
As the impact and severity of crypto ransomware attacks has grown, Webroot has fought back, not just by building a next-gen endpoint solution capable of preventing ransomware attacks but also by being a thought leader.

 
LVL 51

Expert Comment

by:ahoffmann
ID: 17976161
if you add
   RewriteBase /
then /cb is still a directory there, which is never reached with above rules.
Could you please explain how that works now.
0
 

Author Comment

by:matthewdacruz
ID: 17977889
Hi Hoffman

I had not seen your comment when i had responded and awarded the points to yessirnosir .
here is what i had done.

RewriteEngine On
RewriteBase /
RewriteRule   ^cb(.*)$      -      [L]

This allowed my application to run. Please excuse me if i was wrong and could you let me know if I am wrong. To be honest this is the first time i have worked with an .htaccess file. I am not familiar with the rules. I just copied what was working and modified it.

It seemed to do the trick but i have no idea of the conciquences.

Thanks


MDC
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 17978175
aha, so your own added rule ^cb(.*) fixed the problem, not the RewriteBase
0
 

Author Comment

by:matthewdacruz
ID: 17978192
Ye thats what i did
what is the RewriteBase do?

MDC
0
 
LVL 14

Expert Comment

by:yessirnosir
ID: 17992850
It would be interesting to test what happens without the rewritebase command.  When I saw the original post, I figured that if the problem had only been the missing "cb" redirect, then any request for something in the cb directory would have been redirected by the original .htaccess to index.php.  The fact that it gave a 404 error suggested to me that the bigger problem was the lack of a rewritebase command.   But I agree with ahoffman that it needed the cb rule too, so certainly if you wanted to ask moderators to re-allocate points (can they do that?) that would be fair.
0
 

Author Comment

by:matthewdacruz
ID: 17994259
Where would i do that, to re allocate points

thanks

mdc
0
 
LVL 14

Expert Comment

by:yessirnosir
ID: 17995549
I think you would post a question over in "community support".    It looks like you can ask for a question to be re-opened, and that would allow you to change points splits.

http://www.experts-exchange.com/Community_Support/
0
 

Author Comment

by:matthewdacruz
ID: 17996468
Hi Guys

I have allocated the point to bioth of you and split it down the middle. I hope you have both recieved the credits. Thanks for the help

MDC
0
 
LVL 14

Expert Comment

by:yessirnosir
ID: 17996553
Thanks.  
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 17996710
Thanks.
0

Featured Post

Need protection from advanced malware attacks?

Look no further than WatchGuard's Total Security Suite, providing defense in depth against today's most headlining attacks like Petya 2.0 and WannaCry. Keep your organization out of the news with protection from known and unknown threats.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The conference as a whole was very interesting, although if one has to make a choice between this one and some others, you may want to check out the others.  This conference is aimed mainly at government agencies.  So it addresses the various compli…
Let's recap what we learned from yesterday's Skyport Systems webinar.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question