May 21, 2012, 05:11:08 PM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: Mobile users - Our forum is Tapatalk enabled.
http://www.tapatalk.com/
Home
Help
Search
Login
Register
DotDragnet
>
The Tech Side
>
Tech stuff
>
htaccess query
Pages: [
1
]
Go Down
« previous
next »
Print
Author
Topic: htaccess query (Read 1028 times)
sarahA
DDN Contribs
Hero Member
Posts: 2174
htaccess query
«
on:
November 01, 2007, 12:45:05 PM »
Can anyone tell me why the following may not work?
Code:
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^sitemap.php?id=(.*)$ http://www.domain.co.uk/sitemap.php [L,R=301]
tyvm
Logged
Stuff By Me
:
Photos
JasonD
Global Moderator
Hero Member
Posts: 546
Re: htaccess query
«
Reply #1 on:
November 01, 2007, 01:02:51 PM »
\?
Otherwise it only matches sitemap.phpid= or sitemap.phid=
You need to (.*)$ to capture the end unless you use plan on using it in a back reference.
Logged
Jeewhizz
DDN Contribs
Hero Member
Posts: 1626
Re: htaccess query
«
Reply #2 on:
November 02, 2007, 11:38:48 AM »
You can't match a question mark on a rewriterule...
RewriteEngine On
RewriteCond %{QUERY_STRING} .
RewriteRule ^sitemap.php /sitemap.php? [L,R=301]
That should do something similar.
Logged
UK Web Design
Airport Car Parking
Check out my
blog
Business Forums
sarahA
DDN Contribs
Hero Member
Posts: 2174
Re: htaccess query
«
Reply #3 on:
November 02, 2007, 12:06:06 PM »
Thanks for the comments. I'd tried your method too Jason, it still didn't work, but Jee's method does.
Just out of interest how easy would it be to just drop one specific variable from the URL eg index.php?a=1&b=2 to just index.php?b=2 ?
It's a potential future question
Logged
Stuff By Me
:
Photos
Pages: [
1
]
Go Up
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> General Discussion
=> Jee's Forum of Appalling Jokes
-----------------------------
The Creative Side
-----------------------------
=> Arty stuff
=> Photography
=> On the web
-----------------------------
The Tech Side
-----------------------------
=> Tech stuff
=> Hardware & Software
-----------------------------
The Business Side
-----------------------------
=> Anything business related
-----------------------------
The Practical Side
-----------------------------
=> Practical Advice
DotDragnet
>
The Tech Side
>
Tech stuff
>
htaccess query
Loading...