Forum Moderators: phranque
RewriteCond %{query_string} ^(.*)$
RewriteCond %{script_name} ^(.*)$
RewriteRule ^/a/b/(.*)$ [example.com...] [QSA,P]
I am not too sure if I need to have the QSA flag. What is desired is if i enter
hello.com/hello1/hello2/hello3?a=1&b=2&c=3 its gets redirected to
[example.com...]
So i get the query string and the file path (/hello1/hello2/hello3 and manually try to append. Where am I going wrong?
RewriteRule ^(.+\.php)$ $1?newparam=qwe [QSA,L]
/index.php => /index.php?newparam=qwe
/index.php?param1=abc => /index.php?param1=abc&newparam=qwe
/index.php?param1=abc¶m2=def => /index.php?param1=abc¶m2=def&newparam=qwe
RewriteRule ^/hello/hello1/(.$)$ [newlink.com...] [QSA,P]
It doesnt seem to add the paramter.
RewriteRule ^/hello/hello1/(.*)$ [newlink.com...] [QSA,P]
Welcome to WebmasterWorld [webmasterworld.com]!
Do not use a canonical URL -- See gergoe's code above.
Why are you using the Proxy flag?
And if you are putting your code in .htaccess, omit the leading slash from the pattern. From your last post:
RewriteRule ^hello/hello1/(.*)$ /$1?newparam=qwe [QSA,L]
This will rewrite www.example.com/hello/hello/somepage?a=5 to www.example.com/sompage?a=5&newparm=qwe
Apache mod_rewrite documentation [httpd.apache.org]
Jim