Solved

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

Posted on 2006-11-18
14
189 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
  • 5
  • 4
  • 4
14 Comments
 
LVL 14

Assisted Solution

by:yessirnosir
yessirnosir earned 250 total points
Comment Utility
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
Comment Utility
>  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
Comment Utility
Thanks Dude!

That fixed the problem...


MDC
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
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
Comment Utility
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
Comment Utility
aha, so your own added rule ^cb(.*) fixed the problem, not the RewriteBase
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:matthewdacruz
Comment Utility
Ye thats what i did
what is the RewriteBase do?

MDC
0
 
LVL 14

Expert Comment

by:yessirnosir
Comment Utility
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
Comment Utility
Where would i do that, to re allocate points

thanks

mdc
0
 
LVL 14

Expert Comment

by:yessirnosir
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks.  
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
Thanks.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Article by: btan
Provide an easy one stop to quickly get the relevant information on common asked question on Ransomware in Expert Exchange.
By this time the large percentage of day-to-day transactions have shifted to mobile banking; here are some overriding areas QAs must investigate while testing mobile banking apps.  
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now