Thanks again for your great help Richard!
So rules in /~accountname/example.com/sub/.htaccess do not work?
>the rules for the subdomains do not work (and there is no .htaccess file in the map for the created sub domains) only 1 in the lower directory name "domain.com". I would like to create and use rules for sub domains just by editing 1 .htacess file and without having to create submaps on the server (especially as I would also like that ruels for wildcard sub domains work)
----------------------------------
When I put
Options +FollowSymLinks
RewriteEngine On
RewriteOptions Inherit
RewriteRule Google
http://www.google.com/? [NC,R,L]
in the higher level .htaccess file (in the map public_html) (and not in the lower map .htacess file in the map example.com):
It does not redirect if I go to
http://example.com/google (404 not found)
It does not redirecy if I go to
http://example.com/~accountname/example.com/sub/google?
I have not tried: "does
http://example.com/~accountname/example.com/sub/google redirect if you remove /public_html/.htaccess?" as the Google redirect rule is only in this file.
So I think this is not what you have meant and so I also tried the only other option:
-----------------------------
When I put
Options +FollowSymLinks
RewriteEngine On
RewriteOptions Inherit
RewriteRule Google
http://www.google.com/? [NC,R,L]
in the lower level .htaccess file (in the map example.com) (and not in the higher map .htacess file in the map public_html):
the higher map .htacess file in the map public_html contains:
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/~r8km1info/8km1.info(.*) [NC]
RewriteRule ^(.*)$ /~r8km1info/8km1.info/$1
Does it redirect if you go to
http://sub.example.com/google? YES!
Does it redirect if you go to
http://example.com/~accountname/example.com/sub/google? YES!
Does
http://example.com/~accountname/example.com/sub/google redirect if you remove /public_html/.htaccess? YES!
What shall I do Richard? Do I have to restore /public_html/.htaccess file?
The rule now also works for sub domains (which have been created on the server), but not for the non existing (wildcard sub domains). Then I get the message: "Apache is functioning normally" when I go to such a non existing (wildcard sub domain) and the /google I get a 404 error.
Is there a solution for these (wildcard sub domains)?
---------------
Follow up question:
we would also to use the following rule:
RewriteCond %{QUERY_STRING} ^(.*&)?q=1(&.*)?$ [NC]
RewriteRule ^$
http://example.com/new-url-1?%1%2 [R=301,L]
RewriteCond %{QUERY_STRING} ^(.*&)?q=2(&.*)?$ [NC]
RewriteRule ^$
http://example.com/new-url-2?%1%2 [R=301,L]
is it possible to integrate another rule? That is: if q=2 then the parameter c= (when this parameter appears in the url) then this parameter will be changed into the parameter m=
For example: test.com?q=1&c=aa will then redirect to
http://example.com/new-url-1?m=aa (and test.com?a=1&c=aa&q=1 will then redirect to
http://example.com/new-url-1?a=1&m=aa)