Forum Moderators: phranque

Message Too Old, No Replies

"Front Ending" a page

Front ending a page and restricting access.

         

shadowedsniper

11:59 pm on Sep 6, 2005 (gmt 0)



Hey there. Im fairly new to Apache, but not to web design. What im trying to do is make a site that serves up pages, but before it reaches the user, front end it to see where the request came from. If the request comes from in the network (10.x), then show an administrative page...Otherwise, the standard page. I think this might need .htaccess, but I have only heard of it (as im new to apache). Any help would be greatly appriciated.

Thanks.

jdMorgan

9:23 pm on Sep 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



shadowedsniper,

Welcome to WebmasterWorld!

You'll need to use mod_rewrite [httpd.apache.org]'s RewriteCond directive, and test the requestor's IP address:


# If internal address (allows for 254 internal addresses by omitting last octet)
RewriteCond %{REMOTE_ADDR} ^10\.0\.0\.
# Serve admin page
RewriteRule ^some_page\.html$ /admin.html [L]
# Else serve extern page
RewriteRule ^some_page\.html$ /extern.html [L]

Jim