![]() |
.htaccess question - query sting param redirect
$10 epass and my eternal gratitude for a working solution:
I need to 301 redirect urls with a specific query string parameter (any value) to my main url. In other words: Code:
http://www.domain.com/index.php?cat=x Code:
http://www.domain.com but Code:
http://www.domain.com/index.php?dir=x |
why use htaccess to do that? why not just use php?
|
put this at the top of your index.php
Certain values PHP Code:
Any Value PHP Code:
|
Yo, you're awesome for posting that, but no dice. I tried the code in index.php but it had no affect. This script has so many .php functions and external files - totally beyond my grasp. That's why I was hoping for a neat and tidy .htaccess fix.
Hit me up with your epass though! mcurtis313 at gmail dot com |
Code:
RewriteEngine on |
Quote:
http://www.domain.com/?cat=x I want to kill the trailing slash and query string for the canonical URL. |
Okay, then change it to this:
Code:
RewriteEngine on |
WINNER!
I've still got the trailing slash (www.domain.com/) but that's damn close. Hit me up with your epass :thumbsup mcurtic313 a t gmail d o t com |
no epass needed. just hit me up if you need a programmer in the future.
note: even if you put the url in your browser without the trailing slash, you'll see it refresh WITH the slash. |
You, sir, are the man. I will.
|
All times are GMT -7. The time now is 11:36 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123