Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

Subscribe to HRA Now!

 



Are you a Google Analytics enthusiast?

Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE! 

 



 

 www.CustomReportSharing.com 

From the folks who brought you High Rankings!



Photo
- - - - -

Redirect Failing For Custom Page Changes


  • Please log in to reply
1 reply to this topic

#1 bobmeetin

bobmeetin

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 532 posts
  • Location:Colorado

Posted 29 October 2012 - 08:25 AM

I have to set up a bunch of custom rewrite rules for various pages where the content as moved. I use something like:

RewriteRule view-page.php?id=145 http://www.mysite.com/index.php/newpath/item/$new_numberR=301,L

Unfortunately this is throwing a 404 error. It is balking at the question mark and what follows. I verified this by testing some simple lines without the question mark such as:

RewriteRule view-page.php http://www.mysite.com/index.php/newpath/item/$new_number  [R=301,L]

which works but is useless without the ?id=$number

Just guessing I tried things like a backslash in front of the question mark ( \> ), added a slash and even full path at the very beginning:

RewriteRule /view-page.php\?id=145 http://www.mysite.com/index.php/newpath/item/$new_numberR=301,L]
RewriteRule /view-page.php?id=145 http://www.mysite.com/index.php/newpath/item/$new_numberR=301,L]
RewriteRule http://www.mysite.com/view-page.php?id=145 http://www.mysite.com/index.php/newpath/item/$new_numberR=301,L]

Where to next?

#2 bobmeetin

bobmeetin

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 532 posts
  • Location:Colorado

Posted 29 October 2012 - 04:59 PM

Figured this out, here is what worked, 2 lines of code for each:
RewriteCond %{QUERY_STRING} report_id=145
RewriteRule ^(.*)$ index.php?option=whatever&id=269 [L,R=301]
QUERY_STRING is verbatim; you don't replace it.

Edited by bobmeetin, 29 October 2012 - 04:59 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

SPAM FREE FORUM!
 
If you are just registering to spam,
don't bother. You will be wasting your
time as your spam will never see the
light of day!