In fact I don't want ids to be displayed in url bar. I managed to remove .php trough .htacess and it's now showing: https://example.com/article?id=27 For pages like "example.com/blog.php" to be like "example.com/blog", I have to modify the corresponding in the code like this: instead of <a href="blog.php", here it works fine and it redirects to desired link ( "http://example.com/blog "). But, When it comes to pages like : article.php?id=, I don’t see how to modify this or what to write in .htacess.
I searched here and there but it seems it's not giving what I want
I tried this:
In .htacess: RewriteRule ^([^.]+)/?$ bloge.php?id=$1 [L, QSA]
In the code: href="article?id=" It's showing: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request.
how to remove = and ? from URL in php by someone was not answered and it's the same as what I was looking for.
if the page article.php is expecting the id to be passed via GET you can't without changing also the application.
if you can change the application you can "hide" the param passing it via POST. Mind the quotation marks as you can't actually hide the param, using POST method it won't be visible on the URL but it's always visible (and exploitable if that's your concern) in the HTTP request.
if you can't change the application and you have programming skills you could write a front-end wrapper around it in JS or even a server side language as php that translates the web page in whatever format you choose to display it and back, but "could" and "should" don't always meet, knowing why you want this could help finding a solution to your problem.