Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

allow access to a single file

Status
Not open for further replies.

stasJohn

Programmer
May 6, 2004
155
0
0
US
Hi all.

The company network is a linux box (FC 5) running apache 1.3. It is also closed to the outside.

We have a company wordpress blog. A couple people have complained that they can't subscribe to the RSS feed from their google homepage.

This obviously makes sense, because the network is closed from the outside. So, my question is how can I open access to just the rss feed?

I tried the following in httpd.conf, but it did not work
Code:
<Location ~ "^/blog/index.php\?feed*$">
  Order allow,deny
  Allow from All
</Location>

Any ideas? Can this even be done? Thanks in advance.
 
First, if it's a seperate firewall that's preventing access from outside, changing apache won't make any difference.

Second, if the rss feed works from inside, there's nothing that needs to be changed with apache.
 
Hi

I do not think that could work. The parameter of the [tt]Location[/tt] is only matched against directory names.

Sadly neither the [tt]SetEnvIf[/tt] can match the query string.

For me seems the only solution is [tt]RewriteCond[/tt] :
Code:
RewriteCond %{QUERY_STRING} (feed).* [E=go:%1]
<Files "/blog/index.php">
  Order Deny,Allow
  Deny from all
  Allow from go=feed
</Location>
Not tested at all ( no Apache handy ).

Feherke.
 
There is a firewall, but port 80 is not blocked.

Second, if the rss feed works from inside, there's nothing that needs to be changed with apache.
Google says it can't find it.

feherke, I changed wordpress to use mod_rewrite, so the feed url is now "/blog/feed", so following your example, I figured the following would work, but doesn't.

Code:
<Files "/blog/feed">
  Order allow,deny
  Allow from All
</Files>
 
Hi

rewrite_tech.html said:
Mod_rewrite uses two of these hooks: the URL-to-filename translation hook which is used after the HTTP request has been read but before any authorization starts and the Fixup hook which is triggered after the authorization phases and after the per-directory config files (.htaccess) have been read, but before the content handler is activated.

You can not do that. The requested URL is translated before the [tt]Files[/tt] directive is processed.

Feherke.
 
I need to take a step back because I think I'm missing an important piece of the puzzle or misundersanding what's been posted.

If
port 80 is not blocked
then, what is causing your server to be
also closed to the outside
?
 
smah,

Code:
<Directory "/">
  Options -Indexes FollowSymLinks MultiViews +Includes
  AllowOverride All
  Order allow,deny
  Allow from [ip of internal network]
  AuthType Basic
  AuthName "intranet"
  AuthUserFile /path/to/.htpasswd
  Require user user1 user2 user3
  Satisfy any
</Directory>
 
The above code closes the server to the outside and sets up http authentication to allow access from home using a user/pass.
 
feherke

Code:
RewriteCond %{QUERY_STRING} (feed).* [E=go:%1]
<Files "/blog/index.php">
  Order Deny,Allow
  Deny from all
  Allow from go=feed
</Files>

Apache throws "RewriteCond: unknown flag 'E'". Is my apache missing something?
 
Hi

stasJohn said:
Is my apache missing something?
As I have no better idea, I would say yes. Also I have to mention here, that I experienced strange differences with unexplainable error message between two machines. Maybe your mod_rewrite is abit old...

Feherke.
 
As I have no better idea, I would say yes. Also I have to mention here, that I experienced strange differences with unexplainable error message between two machines. Maybe your mod_rewrite is abit old...
Its whatever came with the latest version of apache 1.3

I'll investigate further soon.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top