1
votes

i've encountered the following problem:

The .htaccess

RewriteEngine On

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule view/^(.*)$ view.php?id=$1 [L,QSA]

Is not rewriting my urls

The friendly URL should be like this

https://domain.tld/view/1

And the original url should be rewritten like this:

https://domain.tld/view.php?id=1

The result of the htaccess above is a 404.

1
Try RewriteRule view/(.*)$ view.php?id=$1 [L,QSA] at last line. I'vent tried it but as far as i know ^ is used to declare beggining of the sentence. - lkdhruw

1 Answers

2
votes

Try

RewriteRule ^view/(.*)$  view.php?id=$1 [L]