Mod Rewrite
Moderator: General Moderators
Mod Rewrite
Hi
Heres an easy one but just cant get my head around it
I need to rewrite the following Url:
http://domain1.com/images.php?Id=25
to
http://domain2.com/images.php?Id=25
Id not always 25 !!
Any Ideas ??
Heres an easy one but just cant get my head around it
I need to rewrite the following Url:
http://domain1.com/images.php?Id=25
to
http://domain2.com/images.php?Id=25
Id not always 25 !!
Any Ideas ??
Code: Select all
RewriteEngine on
RewriteRule ^/images.php?Id=(d+) http://domain2.com/images.php?Id=$1Thanks but that didn`t work - what is the (d+) for ?
should it not be something like
should it not be something like
Code: Select all
RewriteRule ^/images.php?Id=(.*)$ http://domain2/image.php?Id=$1I was under impression that mod_rewrite used PCRE regexps. It didn't.leewad wrote:Thanks but that didn`t work - what is the (d+) for ?
Nope, it should be something like:leewad wrote: should it not be something likeCode: Select all
RewriteRule ^/images.php?Id=(.*)$ http://domain2/image.php?Id=$1
Code: Select all
RewriteRule ^/images.php?Id=(ї0-9]+)$ http://domain2/image.php?Id=$1- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Nothing - what should it have returned ?
I have the another mod_rewrite which works fine:
But cant get the other one to work
I have the another mod_rewrite which works fine:
Code: Select all
^newimage/(.*).jpg$ http://www.domain2/sales/$1.jpgNot tested but you could try....
or, as escaping special characters is borked on some versions.....
Code: Select all
RewriteEngine on
RewriteRule ^images\.php\?Id=(ї0-9]+)$ http://domain2/image.php?Id=$1 їR]Code: Select all
RewriteEngine on
RewriteRule ^images\.php(.*) http://domain2/image.php$1 їR]