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 Answers1

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

  • 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 '14 at 03:12