Solved

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

Posted on 2006-11-18
14
190 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
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
 
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
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
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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Firewall Philosophy and Risks 8 127
Add Servers IP Address to pregenerated mail 11 88
Security training 4 57
Recommended Android live viewer for IP cam sys? 1 26
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.  
Three simple tips to quickly and efficiently back up and protect the contents of your PC and Mac®.
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…
A simple description of email encryption using a secure portal service. This is one of the choices offered by The Email Laundry for email encryption. The other choices are pdf encryption which creates an encrypted pdf of your email and any attachmen…

920 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

16 Experts available now in Live!

Get 1:1 Help Now