Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
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?
RewriteEngine On RewriteRule ^project/(.*) /public/?$1 [L,NC]
Add a comment
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.
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]
Required, but never shown
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.
Explore related questions
See similar questions with these tags.