I want to show the URL  

`http://some.com/designit/portfolio.php?cat=website&subcat=nature`  

as  

`http://some.com/designit/portfolio/website/nature.`

`cat` and `subcat` in the URLs may be present, but not always. 

I have put this .htaccess file in designit folder:

```
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ $1.php [L,QSA]
RewriteRule ^portfolio/?$ portfolio.php[NC,QSA]
RewriteRule ^portfolio/([a-zA-Z0-9_-]+)/?$ portfolio.php?cat=$1[L,NC,QSA]

```

Now, It is showing  

`..some.com/designit/portfolio.php`  

as  

`..some.com/designit/portfolio` 

but it is not showing  

`..some.com/designit/portfolio.php?cat=website`  

as  

`..some.com/designit/portfolio/website`

I get "Internal Server Error.The server encountered an internal error or misconfiguration and was unable to complete your request."

What do I need to do to fix this?