skip to Main Content

htaccess redirect query string, but encoded ? to & – Apache

I want to redirect https://www.aaa.com/query?v=abc123_ABC to: https://bbb.com/?url=https://www.aaa.com/query?v=abc123_ABC I use this in .htaccess: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ https://bbb.com/?url=https://www.aaa.com/$1 [L,B,NE,NC,QSA,R=301] </IfModule> But the output is: https://bbb.com/?url=https://www.aaa.com/query&v=abc123_ABC The ? was converted into &, what's wrong…

VIEW QUESTION

Replace query string with file extension using htaccess – Apache

I have this link https://career.guru99.com/top-50-oops-interview-questions/?format=pdf I want to redirect it to https://career.guru99.com/pdf/top-50-oops-interview-questions.pdf I created the following htaccess rule RewriteEngine On RewriteCond %{QUERY_STRING} format=pdf [NC] RewriteRule ^top-50-oops-interview-questions /pdf/top-50-oops-interview-questions.pdf? [R=301,L] But the challenge is I have 200+ links and I will have…

VIEW QUESTION

.htaccess Redirect all pages except one and another internal redirect of a certain domain – Apache

I want to redirect all request of one particular domain to another, except for one page request. I hope my attempt explains what I try to do: RewriteEngine on Rewritecond %{HTTP_HOST} !^host.mysite.com RewriteRule ^link/([^/]+)/([^/]+)/([^/]+)$ dokument_by_link.php?$1=1&document_type=$2&value=$3 [NC,L] Rewritecond %{HTTP_HOST} !^host.mysite.com RewriteCond…

VIEW QUESTION
Back To Top
Search