-4

Hi friends i'm new to php, kindly help me how to make seo friendly url of my php website, Dynamic link is: http://watchfullmovie1.com/pk/software_detail.php?mcat=windows&catid=downloaders&slug=internet_download_manager_idm_2

how to make friendly url with .htaccess

This is what I have so far, but it is not working:

## RewriteRule ^(.+)/(.+)$ /software_detail.php?slug=$1&mcat=$2 [NC,L]
Lexib0y
  • 519
  • 10
  • 27

1 Answers1

1

I think what you want to do is to allow pretty urls like:

http://domain.com/movie/windows/internet/idm2

.htaccess file:

RewriteEngine On

# This will send all requests to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^[^\.]*[^/]$ index.php  [L]

index.php file:

<?php
// parse incoming url and decide what to do
$paths=explode("/", $_SERVER['REQUEST_URI']);
// $paths[1] == "movie"
// $paths[0] == "windows"

// now you can decide what to do:
switch( $paths[1] ){
   case 'movie':
         ...
         break;
   case 'something_else':
         ...
         break;
   default:
         ...
 }
timh
  • 1,572
  • 2
  • 15
  • 25
  • Thank you for reply, i already make .htaccess but its not working, i show you code of .htaccess file ## RewriteRule ^(.+)/(.+)$ /software_detail.php?slug=$1&mcat=$2 [NC,L] – Sikander Rafique Mar 04 '15 at 07:14