Reputation: 29
I am trying to take my link domain.com/view.php?id=12345 and my it to be domain.com/view/12345
I'm unsure on to have I need to do, or what so here are my questions:
Here is my current rewrite rule. I know it's using the file because I did a test earlier from anther questions I found.
RewriteEngine On
RewriteRule ^view/([0-9]+)/$ view.php?id=$1
Upvotes: 0
Views: 43
Reputation: 9040
You don't need a folder.
It's ok.
In view.php somewhere:
$filteredId = someFilterFunction($_GET['id']);
header('Location: /view/' + $filteredId);
But it's probably going to be an infinite redirect :) so don't do it. You should check the request url for example.
4 . I don't understand the question.
Upvotes: 1