N
N
newaitix2019-05-10 23:18:03
Apache HTTP Server
newaitix, 2019-05-10 23:18:03

How to set RewriteRule in htaccess?

RewriteRule ^_oauth/facebook(.*)$ prepend.php$1
I need to additionally transfer facebook to the prepend.php file
This does not work

RewriteRule ^_oauth/(facebook)?(.*)$ prepend.php?$1&$2

url looks like this
/_oauth/facebook?close&code=AQBQtx0hhBzJiCSK7EpbesXmFk-P4-GrWSJUDmWSSKC4oDV4nk#_=_

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
newaitix, 2019-05-11
@newaitix

Correct answer
RewriteRule ^_oauth/facebook$ /prepend.php?c=facebook&%{QUERY_STRING}
RewriteRule ^_oauth/go$ /prepend.php?c=go&%{QUERY_STRING}
This is the only way to get $_GET[ in prepend.php 'c'] and everything else in the query string

A
Alfieros, 2019-05-11
@mrsexy

RewriteEngine On
RewriteCond %{HTTP_HOST} example.com
RewriteRule (.*) http://example.com/_oauth/facebook?close&code=AQBQtx0hhBzJiCSK7EpbesXmFk-P4-GrWSJUDmWSSKC4oDV4nk#_=_/$1 [R=301,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question