
Originally Posted by
blakec
So, do you mean that if I use .htaccess like this:
Code:
<Files "main.html">
deny from all
allow from (server IP address)
</Files>
I can't use AJAX to access main.html? (That's what I'm trying to do, but it's not working.)
Is there ANY way that I can use AJAX to include main.html on a different page, but disallow anyone from actually visiting main.html?
When you request a file via AJAX, where do you think the request comes from?
It comes from your browser.
Not from the server.
Your browser is requesting the server to send the page.
Same as if you clicked on a link to main.html
Same as if you enetered the URL into the address bar.
The only way the request will be allowed, giving the above configuration is if your browser is on the machine running the server.
Edit: ADD:
%{REQUEST_URI} is the part of the url after the first /, ie if
http://forums.x10hosting.com/editpos...epost&p=579843
%{REQUEST_URI} would be editpost.php?do=updatepost&p=579843
Code:
<IfModule mod_rewrite.c> MAKE SURE APACHE HAS THE MOD LOADED, USUALLY IS
RewriteEngine On TELL THE MOD TO START WORKING
RewriteCond %{REQUEST_URI} someplace$ [NC] IF URI ENDS IN someplace , NC == case insensitive
RewriteRule ^someplace$ index.php?p1=someplace REPLACE THE STRING someplace WITH index.php?p1=someplace
</IfModule>