John
John

Reputation: 952

Internal Server Error after changing htaccess

I am getting a Internal Server Error after changing my .htaccess.

What I want is I want to change the following URL:

www.mydomainname.com/map/Change?internal_id=abc123

To:

www.mydomainname.com/map/Change/abc123

When I open www.mydomainname.com/map/Change/abc123 I get a Internal Server Error. The other link is still accessible.

Here is my .htaccess:

RewriteEngine on
RewriteRule ^Change/(.*)$ Change.php?internal_id=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+?)/?$ $1.php [L]

php_value session.cookie_domain .mydomainname.com

When I open the error_log I cant see any logs that are related to this issue.

Does someone know why the page isnt working?

Upvotes: 1

Views: 374

Answers (2)

user11330606
user11330606

Reputation:

This is the correct way to do it:

RewriteEngine on
#dont show .html
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html
#dont show .php
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php

#making clean urls
RewriteRule ^map/Change/abc123 map/Change?internal_id=abc123

Upvotes: 1

John
John

Reputation: 952

I solved it by changing

RewriteRule ^Change/(.*)$ Change.php?internal_id=$1 [L]

to

RewriteRule ^map/Change/(.*)$ map/Change.php?internal_id=$1 [L]

Upvotes: 0

Related Questions