3

I am trying to make Apache send:
http://mydomain.com/these/are/arguments/mmmk

to:
http://mydomain.com/?pages=these/are/arguments/mmmk

Such that $_GET['pages'] will display these/are/arguments/mmmk.

I have set 'AllowEncodedSlashes' to On.

The rule needs to be able to handle trailing slashes, and when there is no subpages (like http://mydomain.com)

Does anyone know how to accomplish this task?

1 Answer 1

4

In order to not rewrite images/scripts you'll need to make sure the file or directory does not exist first in your .htaccess file

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d

  # Rewrite everything else through the pages parameter 
  RewriteRule ^(.+)$ /?pages=$1 [L] 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.