YeuSeChia YeuSeChia - 3 months ago 8
Apache Configuration Question

How to re-write the link, with ".htaccess", in a sub-folder?

I I have this website, with this structure:

http://example.com/-/?id=1234
. Now, I want to edit this link to:
http://example.com/-/1234
.




So, I put an
.htaccess
in
http://example.com/-/
; there is content:

RewriteEngine On
RewriteRule ^/?-/([0-9]+)$ /index.php?id=$1


Unfortunately, it always shows:
Error - 500
.




What is wrong with my
.htaccess
?





My question is not duplicated with any existed question ...

Answer

According to your request, this is your server structure:

"/" (root)
|
|___ "-" (directory)
|
|___ .htaccess
|___ index.php

Before you make a .htaccess file, please check your server configuration.

RewriteEngine On
RewriteRule ^([0-9]+)$ ?x=$1