Solved

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

Posted on 2006-11-18
14
194 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 250 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 250 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
Retailers - Is your network secure?

With the prevalence of social media & networking tools, for retailers, reputation is critical. Have you considered the impact your network security could have in your customer's experience? Learn more in our Retail Security Resource Kit Today!

 
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

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

Keystroke loggers have been around for a very long time. While the threat is old, some of the remedies are new!
Recovering from what the press called "the largest-ever cyber-attack", IT departments worldwide are discussing ways to defend against this in the future. In this process, many people are looking for immediate actions while, instead, they need to tho…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

690 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