last day (15 days later) » 

10:50 AM
3
A: Rewrite and redirect with php variables

Sahil GulatiHope this simplest one will help you out. This will redirect if 1. REQUEST_URI is /channel.php 2. QUERY_STRING matches this pattern id=something&name=something&date=something Redirect this to /channel-%1-%2.html here 1. %1 will hold value of name parameter 2. %2 will hold valu...

 
@OtávioBarreto thanks friend.. :)
 
It works but I'm getting a 404 error
i keep getting 404 error, why?
 
@user2490424 sorry it was 12:00 according to gmt +5 30 thats why i was not able to reply, can you tell you are getting 404 for which file, so is your that html file on which you are redirecting exists?
 
Sorry if I didn't explain myself properly. I want both rewrite and redirect. Do you think this would be ok? RewriteEngine On RewriteCond %{THE_REQUEST} ^(GET|POST)\ /channel\.php\?name=(.*)&data=(.*)\ HTTP RewriteRule ^channel.php /channel/%2/%3? [R,L] #Internal rewrite RewriteRule ^channel/(.*)/(.*)$ /channel.php?name=$1&data=$2 [L]
 
@user2490424 I dont think it is good way, I have to test it further, but my .htaccess will work fine. for sure
 
10:50 AM
with yours .htacces i get 404 error for channel-bbc-today.html, channel-bbc-tomorrow.html etc.
 
is you channel-bbc-today.html exists?
 
thanks for helping me. no, it doesnt
 
so you actually want to rewrite request to channel.php
is it right>
?
 
yes, i want channel.php to work behind the scenes.
 
okay
Sorry, I am in office is it okay that i will provide after an hour but definitely i will give you the best way out.
is it okay?
 
11:04 AM
of couse, thank you so much
 

  last day (15 days later) »