Vijay V.
Vijay V.

Reputation: 566

Getting issue in SEO Friendly URL in PHP

I am getting issue in .htaccess when I am trying to open any page though seo-friendly URL, then getting "Object Not Found" issue.

Below is my code in .htaccess:

RewriteEngine On
RewriteRule (.*)/$ page.php?&page_id=$1

What I want

http://www.domain.com/about-us

But when I am trying to open above URL I'm getting "Object Not Found" issue.

Upvotes: 0

Views: 64

Answers (1)

Niet the Dark Absol
Niet the Dark Absol

Reputation: 324620

Your RewriteRule is looking for "something that ends with /".

http://example.com/about-us clearly does not end with /

So... what did you expect?

Try:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) page.php?page_id=$1

Upvotes: 1

Related Questions