StudioTime
StudioTime

Reputation: 23959

URL not rewriting correctly

I have a url which is:

http://example.com/NEW2014/portfolio/project.html?project_name=test

Which I want to be able to rewrite to:

http://example.com/NEW2014/portfolio/project/test

This is what I'm trying but I get 500 Internal Server error

RewriteRule ^portfolio/([^/.]*)/?$ /portfolio/project.html?project_name=$1 [L,QSA,NC]

Is there a better way to do this?

Upvotes: 1

Views: 29

Answers (1)

anubhava
anubhava

Reputation: 784898

You're getting 500 internal error because your rule is looping. To fix this have this rule in /NEW2014/portfolio/.htaccess:

Options -MultiViews
RewriteEngine On
RewriteBase /NEW2014/portfolio/

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^project/(.+?)/?$ project.html?project_name=$1 [L,QSA,NC]

Upvotes: 1

Related Questions