0

I have a given URL:

http://www.simtalltd.com/hebrew/index.php?option=com_content&task=view&id=15&Itemid=29

And I need to get all the string after: http://www.simtalltd.com/

Like this: hebrew/index.php?option=com_content&task=view&id=15&Itemid=29

I've tried this code:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /index.asp?rewrite_url=$1 [QSA,L,NU]

But I just get: hebrew/index.php

What is the correct code?

Mad Dog Tannen
  • 7,129
  • 5
  • 31
  • 55

1 Answers1

0

Peace of cake! Try using:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^/(.+))$
RewriteRule .* /index.asp?rewrite_url=%1 [NC,QSA,L,NU]

OR you can try to match body of the request and querystring separately:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{QUERY_STRING} ^(.+)$
RewriteRule (.+) /index.asp?rewrite_url=$1\?%1 [NC,QSA,L,NU]
Andrew
  • 511
  • 3
  • 7
  • Thank you for your help but Sorry but both did not work. The first one returns error: Unknown expression on line #22: RewriteCond %{REQUEST_URI} ^/(.+))$ The second one returns just: 'hebrew/index.php?option=com_content' Still missing the full string: 'hebrew/index.php?option=com_content&task=view&id=15&Itemid=29' – Dani Tami Dushinsky Nov 12 '13 at 09:09
  • Oh, it's a typo in in the brackets: RewriteCond %{REQUEST_URI} ^/(.+)$ – Andrew Nov 12 '13 at 13:09