0

I need to deny all access to a certain page/URL on a website and only allow access to that page/URL if they are on the companies IP address or address/range.

This is what I currently have.

RewriteEngine On

RewriteCond %{REMOTE_ADDR} !^111\.222\.333\.444
RewriteCond %{QUERY_STRING} option=com_content&view=article&id=87 [NC]
RewriteRule ^(.*)$ index.php [F,L]

The problem I am having is that I am using friendly URLs and cant figure out how to use a relative or absolute URL in place of "option=com_content&view=article&id=87"

Also if possible, Rather than showing an:

"403 Permission Denied

You do not have permission for this request /index.php?option=com_content&view=article&id=87"

page, I would like to redirect them to a custom page/URL.

Thanks in advance.

1
  • Still looking for an answer to this. Can anyone help?
    – Guy Pierce
    Sep 1, 2014 at 16:24

1 Answer 1

0

You are using Joomla?

It may be easier just to have a Page that is only accessible for registered users - and then only give the login credentials to the company/users that should have access..

That way when anyone without the login would get:

"You are not authorised to view this resource." or something similar,

Would save making some complicated set up with restricting it to IPs etc

1
  • Yes I am on Joomla 2.5. I agree, however access to this specific page can and will be publicly accessed at the business to anyone and I do not want to expose the credentials in risk of them sharing them or logging outside the business. That's why I need to restrict the url and the IP.
    – Guy Pierce
    Aug 27, 2014 at 3:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.