.htaccess help if you please...

Soldato
Joined
24 May 2006
Posts
3,828
Location
Surrey - UK
Hi all,

Sure you've all read numerous posts about htaccess files, and i was pretty confident i was getting quite handy at them, while doing all sorts on a test install locally...

Then came using the rules on my live site, and bam, no worky... :(

Here's what won't work specifically, if anyone can point out what could be wrong i'd really appreciate it...

Code:
RewriteCond %{QUERY_STRING} ^.*\=temp_path.*$ [OR]
RewriteCond %{QUERY_STRING} ^.*\=c_temp.*$ [OR]
RewriteCond %{QUERY_STRING} ^.*//includes/header.php.*$ [OR]
RewriteCond %{QUERY_STRING} ^.*\=(ht|f)tp\:.*$ [NC]
RewriteRule .* - [F,L]

I've tried inside IF module, with and without () brackets, and i'm still stumped why my site is ignoring the conditions...

Local install.... type in.. http://localhost?p=http://www.someremotesite

Forbidden!.. exactly what i want...

Live install .... http://mysite.com?p=http://www. etc...

Reloads the page it's on with the query string still there...

Appreciate some help on this guys... ;)

TIA.
 
Soldato
Joined
18 Oct 2002
Posts
5,464
Location
London Town
Have you turned it on and off again? ;)

Seriously though, make sure you've got a
Code:
RewriteEngine On
at the top of your rules.

Other than that, you might try a
Code:
RewriteBase /
depending on your hosting setup e.g. your docroot is on an alias, symlink or some such.
 
Soldato
OP
Joined
24 May 2006
Posts
3,828
Location
Surrey - UK
Yep it's most definately on, since other conds and rules are getting applied, i'll give the rewritebase a shot..

I'm on a TSOHost linux server..

I'll post back with the full htaccess if the base doesn't help...
 
Soldato
OP
Joined
24 May 2006
Posts
3,828
Location
Surrey - UK
Ok here we go then...

Code:
Options FollowSymlinks

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} ^.*\=temp_path.*$ [OR]
RewriteCond %{QUERY_STRING} ^.*\=c_temp.*$ [OR]
RewriteCond %{QUERY_STRING} ^.*//includes/header.php.*$ [OR]
RewriteCond %{QUERY_STRING} ^.*\=(ht|f)tp\:.*$ [NC]
RewriteRule .* - [F,L]

RewriteCond %{QUERY_STRING} ^p=18$ [NC]
RewriteRule ^/index.php$ http://www.t31os.co.uk/wordpress-create-a-tabbed-sidebar/? [R=301,L]

deny from 195.xx.xx.xx
*trimmed*
deny from 72.xx.xx.xx
The redirect works fine, the IP deny works fine, and Wordpress rules work fine...

I don't obviously have access to the httpd conf on this server else i'd have dived in there already...

I don't think there's anything wrong with the above as it works as expected on the local install. I can only assume at this point the problem is related to the server configuration.

I'm no apache / linux expert though so i could be totally overlooking something simple.

Suggestions all welcome here guys! :)

EDIT::
Checked the access log and it's showing my get request as a 403.... however if a forbidden header is given, should'nt the page in the browser reflect that... ie.

Forbidden

You don't have permission to access etc.....

--- which is what i get when testing locally ---
 
Last edited:
Back
Top Bottom