0

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!

4
Contributors
7
Replies
50
Views
4 Years
Discussion Span
Last Post by 4fridi
0

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.

Edited by LastMitch

0

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!

1

Try this

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

Change

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

To

RewriteRule ^(.*)free(.*)$ notfound.php? [R]
Votes + Comments
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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.