I have a website that contains URLs in this format www.example.com/jobs.php?id=123456
All URLs are stored in a database.
I want to make SEO friendly URLs (example:www.example.com/this-is-my-first-job
)
I have built this website in php.
is it possible to generate SEO friendly urls from the current format without modifying the .htaccess
file ?
2
Answers
I am saying simple.
When someone post a job to my website, I store all information in database and generate a unique key (let say 123456) and populate on a single page based on the URL that would be
www.somewebsite.com?mypage?id=123456
Now I want the existing url to be changed. I want that when user hit this URL, he will automatically be redirected to some different URL that is stored in database too.As far i understand your question, first you need .htaccess for SEO friendly URL. Now, for example
www.example.com/jobs.php?id=123456
is an URL and you want to redirect the user towww.example.com/this-is-my-first-job
which is stored in database.Let see,
How to get the id from slug?
write in .htaccess
now in PHP