1

I'm trying to use mod_rewrite to achieve the following rewrite:

From - http:// pre.domain.com/public/?project=Awesome

To - http:// pre.domain.com/project/Awesome

Can't seem to figure it out (despite reading through endless sites). Any help?

3 Answers 3

1
RewriteEngine On
RewriteRule ^project/(.*) /public/?$1 [L,NC]
Sign up to request clarification or add additional context in comments.

Comments

1
RewriteEngine On
RewriteCond  %{QUERY_STRING}   ^project=(.*)$
RewriteRule   ^/public/         /project/%1/? [R,L] # strip off query string

You need to match against the query string using a RewriteCond.

Comments

0

Not sure you have your URLs around the right way so I think your are trying to do this:

RewriteRule ^project/(Awesome) /public/?project=$1 [L]

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.