php - Rewrite directorys to file and after ? variables


I have this Apache rewrite code in my .htaccess file:

RewriteEngine on
RewriteRule ^main\/(.*) /parser.php?folders=$1

But I can't access the request parameters after?. For example,


How can i access those variables? I use PHP.




You just needQSA flag in your rule:

RewriteEngine on
RewriteRule ^main/(.*)$ /parser.php?folders=$1 [L,QSA,NC]
  • QSA (Query String Append) flag preserves existing query parameters while adding a new one.

People are also looking for solutions to the problem: javascript - Uncaught ReferenceError: ajaxObj is not defined


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.