.htaccess 404 page not found

I am writing my own URL shortener. I am done away with creating short URLs. But when I try to browse htt p://example.com/rtr93, I get 404 error. But it http://example.com/index.php/rtr93works, finds and shows the corresponding page (I am not redirected to the new URL. I just get the corresponding record from the database that has the short_url column).

I use PHP and syfmony 1.2 if this helps. I think I need to configure the .htaccess file correctly. But I don’t know where to start.

+3
source share
1 answer

Something like this should work:

RewriteEngine on
RewriteBase /

RewriteRule ^(.*)$ /index.php [L]

, , .

+1

Source: https://habr.com/ru/post/1711550/


All Articles