I want to change my url to search engine friendly. i am using xampp 3.2.1 on windows 10 with 64-bit
My URLs are looking like this:
http://smc.edu.pk/app/site/?p=12&m=c&u=Swat_Medical_College-_The_Project_of_Swat_Medical_Complex
And I want to make it like this:
http://smc.edu.pk/app/site/12/c/Swat_Medical_College-_The_Project_of_Swat_Medical_Complex.html
i have tested with the following code with .htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/app/site/(d+)/([a-z-]+)/(.+).html$ /?p=$1&m=$2&u=$3 [NC,L]
but it returns the following error when i am using the second url mentioned above:
Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404
smc.edu.pk
Apache/2.4.12 (Win32) OpenSSL/1.0.1l PHP/5.6.8
2
Answers
Yes, i have found the solution:
I have change the RewriteRule to:
And also put the RewriteBase /app/site/ on second line. Now its working perfectly....
I think it should be like this(not tested):
Edit: It should be like this (tested and working):