Jump to content

htaccess - how to allow access to specific file from site/modules


breezer
 Share

Recommended Posts

Hello all, hope everyone's holiday season has been delightful ?

Is there a way to allow a specific .php file to be accessed from site/modules ( which is protected via htaccess )?

I have an ajax file manager which integrates into a ckeditor front end instance which works fine as a .html file, but if accessed through url or in the ckeditor and user has no permission it still shows the user interface ( although all buttons are disabled ). If I rename it to .php I can kill the process and output an informational message.

As a .php file the following directive in htaccess forbids it due to it residing in my module folder.

# Block access to any PHP files in /site/modules/
  RewriteCond %{REQUEST_URI} (^|/)(site|site-[^/]+)/modules/.*\.(php|inc|tpl|module|info\.json)$ [OR]

This is the current url:

/pwire30118/site/modules/Xforum/assets/fileman/dev.html

This preferred:

/pwire30118/site/modules/Xforum/assets/fileman/dev.php

If anyone can help it is greatly appreciated, my eyes are bleeding from reading htaccess articles...
 

Link to comment
Share on other sites

Before you start tweaking your .htaccess (which might be problematic if you want to share your module), how about copying the dev.php to site/templates in your module's install method and creating a dedicated page for it?

  • Like 2
Link to comment
Share on other sites

Yes sir I already tried to use a dedicated pw page but without rewriting the all the code it just wont work. After a little more thought I decided not to modify the htaccess since what I'm wanting to do is just for looks basically.

Thanks and I believe this is resolved. ?

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...