David David - 1 year ago 59
PHP Question

Internal Server Error: Having trouble with mod_rewrite in .htaccess

My URL is like this:


I want to turn it into:


Using Generate It! I get this code:

RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)$ /Folder/index.php?city=$1&id=$2 [L]

But when adding this in my .htaccess file and trying to open
I'm getting the following error:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Apache/2.2.14 (Ubuntu) Server at example.com Port 80

What am I doing wrong? I'm trying since hours to get it work, but without success.

Answer Source

I found the solution:

I'm using this in my .htaccess:

RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)/id/([^/]*)$ /Folder/index.php?city=$1&title=$2&id=$3 [L]

to change this link:



Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download