I have script which has search engine to find mp3 songs, i need that if someone search the site with free mp3 songs or mp3 free songs both keywords has free keyword.
i have redirected with header(); function through my coding in php but what about previously indexed urls with these free kwyrod in google, if someone click on that url it will not redirecting to notfound.php page, i have to redirect those urls with .htacess file please help me
my url pattern is http://mydomain.com/search/songs/free+mp3+songs.html
please help me, my redirecting is working if someone type in text box and hit the search button but its not working if you just directly implement this free keyword in already generated url and hit the enter button it will show up with results i need this too redirect to notfound.php page thanks!

Member Avatar for LastMitch

please help me, my redirecting is working if someone type in text box and hit the search button but its not working if you just directly implement this free keyword in already generated url and hit the enter button it will show up with results i need this too redirect to notfound.php page thanks!

We can help but it is impossible to assist you when you didn't provide any code?

You expect to create a code that let a person search through the database to find that keyword and the person can click a link and redirected to a different page?

I think that's a bit too much work.

Member Avatar for diafol

free+mp3+songs.html

That's an odd url isn't it?

Dears, i only need .htaccess code for redirecting urls, if .htaccess detected keyword free in url it should redirect the url to notfound.php thats it, i think you don't neeed a code for this issue its only a one line solution in .htaccess file please provide me that one line thanks!
Details: if someone copy the url e.g http://mysite.com/search/songs/english+mp3+songs.html u can figure out thre is no free kwyrod, okey after he copied the url and now he input free keywrod to the url and pasted it into browser address bar, and hit the enter, http://mysite.com/search/songs/english+free+mp3+songs.html after this my .htacess file will capture the free keyword in url and redirect this url to http://mysite.com/notfound.php thanks!

Try this

RewriteEngine On
RewriteBase /
RewriteRule ^(.*)free(.*)$ notfound.php [R]

Change

RewriteRule ^(.*)free(.*)$ notfound.php [R]

To

RewriteRule ^(.*)free(.*)$ notfound.php? [R]
commented: great help u solve my issue +0

CODE_RUM you did it, Thanks for your brilliant help and understanding my question and giving a great solution to my problem, now i m giving you ranking and giving this post to solved by code_rum thnx buddy

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.