Reputation: 21
I have a website where my links look like this http://www.domain.com/index.php?lang=English&inc=canyoning I managed to write rewriteRule like this:
RewriteRule (German|English)\/(.*) http://www.domain.com/index.php?lang=$1&inc=$2 [NC,R]
Now my links look like this: <a href="http://www.domain.com/English/canyoning">
...
This works, but I can see non user friendly URL in browser address bar. How can I tell browser to use link like /English/canyoning
in URL and not index.php?lang=English&inc=canyoning
?
And second: I would like to use forms on page. There is no difference, whether I use form method =GET or POST, No variables come to destination site.
I guess there is my rewriteRule wrong. How to fix those issues?
Thank you for help!
Upvotes: 2
Views: 1527
Reputation: 24334
This is because you are doing a redirect not a rewrite.. (The R
flag indicates a Redirect)
So remove the R flag should fix your issue.
You may also need to remove the hardcoded domain. As you are doing a rewrite you cant rewrite to a different domain.
ie. Change
RewriteRule (German|English)\/(.*) http://www.domain.com/index.php?lang=$1&inc=$2 [NC,R]
To
RewriteRule (German|English)\/(.*) /index.php?lang=$1&inc=$2 [NC]
Upvotes: 4