Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By ramz

Thread: Can someone help me figure out error in my htaccess redirection code?

  1. #1
    Junior Member
    Join Date
    Jan 2016
    Posts
    1
    Member #
    52988

    appending query stringt hrough redirect?

    Hi
    I want to create a rewrite/redirect in htaccess
    I want to redirect
    Code:
    http://www.mydomain.com/business/search-results.php?keywords=Animal+Business+Cards&go=Search
    to

    Code:
    http://www.mydomain.com/business/search-results.php?keywords=Animal+Business&go=Search
    or if possible remove the word "+cards" from any search queries... is it possible?
    how please
    Thank You in advance
    Last edited by MGGM82; Jan 16th, 2016 at 05:36 AM.

  2.  

  3. #2
    Junior Member
    Join Date
    Jan 2016
    Posts
    14
    Member #
    53168
    Liked
    1 times
    I wouldn't do it from the .htaccess. I think it's easier from PHP, and has the advantage to be only checked when that function is called, which is better for the site's performance. Once you have received the parameter 'keywords' check if it contains the string '+Cards', with strpos($keywords, '+Cards'), and if so, remove it (with substr). There are many other ways to do it.
    sarahswansea likes this.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Tags for this Thread

All times are GMT -6. The time now is 04:02 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com