newbie
newbie

Reputation:

.htaccess 404 page not found

I'm writing my own url shortener. I'm done with everything such as creating short urls. But when I try to browse htt p://example.com/rtr93, I get a 404 error. But http://example.com/index.php/rtr93 works find and shows the relevant page (I'm not redirecting to a new url. I'm just getting the relevant record from database which has a column short_url).

I'm using PHP and syfmony 1.2 if that helps. I think I need to properly setup .htaccess file. But I don't know where to get started.

Upvotes: 3

Views: 764

Answers (1)

Laurence Gonsalves
Laurence Gonsalves

Reputation: 143314

Something like this should work:

RewriteEngine on
RewriteBase /

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

You may want to make the regex more specific if you're planning on hosting other things on the same domain.

Upvotes: 1

Related Questions