Ad

Rewrite Url For Seo Friendly Htaccess

I want to rewrite this in SEO friendly url.

From - www.example.com/section.php?name=website

To - www.example.com/section/website

I tried this:

RewriteEngine On
RewriteRule ([^/\.]+)/([^/\.]+)?$ section.php?type=$1&service=$2 [NC,L]

I am fetching data using GET method in section.php and pass to the another page but after opening sub folder like www.example.com/{foldername} it returns to the section.php

Thanks. I will appreciate your help.

Ad

Answer

This helps me

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
RewriteRule ([^/\.]+)/([^/\.]+)/?$ search.php?type=$1&service=$2
Ad
source: stackoverflow.com
Ad