Ad

.htaccess Seo Friendly Url Not Found Issue

- 1 answer

I am trying to create SEO Friendly URL using htaccess php.

Here is the original URL :

http://www.example.in/viewitem.php?typedp=bus&viewdp=bus-seat-test-item

expected SEO Friendly URL :

http://www.example.in/bus/bus-seat-test-item

Using the following rule in .htaccess

Options +FollowSymLinks
RewriteEngine on
RewriteRule typedp/(.*)/viewdp/(.*)/ viewitem.php?typedp=$1&viewdp=$2

But it shows as not found 404 error.

I am new to this concept.

any help appreciated.

Ad

Answer

try this one :

RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)$ /viewitem.php?typedp=$1&viewdp=$2 [QSA, L]

take a look at : Mod Rewrite Generator

Ad
source: stackoverflow.com
Ad