1

when i tried to add htaccess redirect on my site facebook login which was working earlier stopped working..

the error it shows is

Cross-site request forgery validation failed. The "state" param from the URL and session do not match.

here is rewrite code I've

RewriteEngine on


RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)$ apps.php?app_id=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)$ apps.php?app_id=$1&user_id=$2 [L]

when I use the above rewrite code FACEBOOK LOGIN is not working if I there is any for loop/while loop in my script. With out loops this rewrite code and FACEBOOK LOGIN works perfectly.

Manoj
  • 35
  • 1
  • 7

1 Answers1

0

try this

RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]

instead of

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
Cr1xus
  • 427
  • 3
  • 20
  • add Options -MultiViews on the top before RewriteEngine On – Cr1xus Nov 20 '15 at 18:17
  • no sir I've used Options +FollowSymLinks Options -MultiViews RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.fbrackets\.com [NC] RewriteRule ^(.*)$ http://fbrackets.com/$1 [L,R=301] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/]+)$ apps.php?app_id=$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/]+)/([^/]+)$ apps.php?app_id=$1&user_id=$2 [L] but still of no use – Manoj Nov 20 '15 at 18:34
  • Sorry, I didn't have the reputation when I left the answer. – Cr1xus Nov 21 '15 at 00:20
  • when I use the above rewrite code FACEBOOK LOGIN is not working if I there is any for loop/while loop in my script. With out loops this rewrite code and FACEBOOK LOGIN works perfectly. – Manoj Nov 21 '15 at 19:21