Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Bug Fixes
Author Message
bavarian
Hangin' Around


Joined: Nov 11, 2004
Posts: 25

PostPosted: Tue Aug 09, 2005 12:27 am Reply with quote

After reading Only registered users can see links on this board! Get registered or login! i did make use of the php-code in the mainfile.php and that did the trick.

now before upgrading to chatservs latest patch, i did some testing to make the REWRITE solution work in the .conf file of my server with some bad luck. cannot make it work.

Everything works fine when i have this set of rules

Code:
......

<IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteCond %{REQUEST_METHOD} ^TRACE
   RewriteRule .* - [F]
   RewriteCond %{HTTP_REFERER} !^$
   RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC]
   RewriteRule \.(gif|jpg|png)$ - [F]
</IfModule>
.....


but when adding the conds/rules to resolve the backslash issue things wont work ... not at all

Code:
......

<IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteCond %{REQUEST_METHOD} ^TRACE
   RewriteRule .* - [F]
   RewriteCond %{HTTP_REFERER} !^$
   RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC]
   RewriteRule \.(gif|jpg|png)$ - [F]
->   RewriteCond %{REQUEST_FILENAME} !-f
->    RewriteCond %{REQUEST_FILENAME} !-d
->    RewriteRule ^/(.*) $1
</IfModule>
.....


the arrows mark the 3 lines of code i added, but with this extra code everything gets messed up.
it is the third line that causes the problem, i am quite sure of that. if there is any guru on Apache and rewrite around i would appreciate some input on what i might do wrong.
 
View user's profile Send private message
sting
Involved
Involved


Joined: Sep 23, 2003
Posts: 456
Location: Somewhere out there...

PostPosted: Wed Aug 10, 2005 6:33 pm Reply with quote

Are you trying to use both the code for the mainfile.php AND the REWRITE fix?

If I am understanding the original article its an either/or, but possibly not both (?) thing.

-sting
 
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
bavarian
PostPosted: Thu Aug 11, 2005 12:27 am Reply with quote

NO ... i am not using both. I commented out the corresponding lines in the mainfile.php, while testing this. I did receive help on another site.There i was told to make changes in one line.

Code:
......

<IfModule mod_rewrite.c>
   ..........
   RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
->    RewriteRule ^/(.+)/$ /$1 [R=301,L]
</IfModule>
.....


the arrow marks the line where the changes were suggested. I don't know why, but this seems to do the trick, at least for me. Hopefully it will not mess up something for the rest of the php-nuke stuff.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Bug Fixes

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©