| Author |
|
morich Newbie

Joined: 25 April 2010 Location: United Kingdom
Online Status: Offline Posts: 15
|
| Posted: 23 May 2010 at 3:41am | IP Logged
|
|
|
Hi need to do Redirecting www version to non-www foe a dot mobi site can you help i found the code below on your site for Redirecting non-www version to www
also i wont to stop any ? quary strings
iam looking for a google frendley way of doing this many thanks
If your web site is accessible through both versions of URL, i.e. http://helicontech.com and http://www.helicontech.com it is a good idea to redirect one version to another to avoid possible duplicate content penalty from search engines. Here is a rule to generally 301 redirect everything non-www to the corresponding www resource. RewriteEngine on
RewriteCond %{HTTPS} (on)? RewriteCond %{HTTP:Host} ^(?!www\.)(.+)$ [NC] RewriteCond %{REQUEST_URI} (.+) RewriteRule .? http(?%1s)://www.%2%3 [R=301,L]
|
| Back to Top |
|
| |
morich Newbie

Joined: 25 April 2010 Location: United Kingdom
Online Status: Offline Posts: 15
|
| Posted: 25 May 2010 at 12:39am | IP Logged
|
|
|
can any one help me on this
|
| Back to Top |
|
| |
Anton Admin Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 10489
|
| Posted: 25 May 2010 at 4:28am | IP Logged
|
|
|
Please try to apply the following config:
RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP:Host} ^(?!www\.)(.+\.mobi)$ [NC]
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http(?%1s)://www.%2%3? [R=301,L]
__________________ Regards,
Anton
|
| Back to Top |
|
| |
morich Newbie

Joined: 25 April 2010 Location: United Kingdom
Online Status: Offline Posts: 15
|
| Posted: 25 May 2010 at 7:24am | IP Logged
|
|
|
Hi tryed that does not work???
[ISAPI_Rewrite] RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP:Host} ^(?!www\.)(.+\.mobi)$ [NC]
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http(?%1s)://www.%2%3? [R=301,L]
should i have put RewriteEngine on not [ISAPI_Rewrite] ???? also it is in a file called httpd is this right ??? sorry for being a pain
|
| Back to Top |
|
| |
Anton Admin Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 10489
|
| Posted: 25 May 2010 at 8:14am | IP Logged
|
|
|
If you are using ISAPI_Rewrite v2, then your config file should be called httpd.ini and the config should be:
[ISAPI_Rewrite]
RewriteCond %HTTPS (on)?
RewriteCond Host: ^(?!www\.)(.+\.mobi)$
RewriteRule (.*) http(?1s)\://www.$2$3 [RP]
__________________ Regards,
Anton
|
| Back to Top |
|
| |
morich Newbie

Joined: 25 April 2010 Location: United Kingdom
Online Status: Offline Posts: 15
|
| Posted: 25 May 2010 at 5:28pm | IP Logged
|
|
|
ok i try it out thanks by the way what is the one for
Redirecting www version to non-www
|
| Back to Top |
|
| |
morich Newbie

Joined: 25 April 2010 Location: United Kingdom
Online Status: Offline Posts: 15
|
| Posted: 25 May 2010 at 5:44pm | IP Logged
|
|
|
[ISAPI_Rewrite]
RewriteCond %HTTPS (on)?
RewriteCond Host: ^(?!www\.)(.+\.mobi)$
RewriteRule (.*) http(?1s)\://www.$2$3 [RP]
HI this does not work gets www.mysite.mobi only i wont mysite.mobi only
|
| Back to Top |
|
| |
Anton Admin Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 10489
|
| Posted: 26 May 2010 at 4:37am | IP Logged
|
|
|
Redirecting www version to non-www:
[ISAPI_Rewrite]
RewriteCond %HTTPS .*(on)?.*
RewriteCond Host: www\.(.+\.mobi)
RewriteRule (.*) http(?1s)\://$2$3 [RP]
And as for existing non-www to www rule, please try the following:
[ISAPI_Rewrite]
RewriteCond %HTTPS .*(on)?.*
RewriteCond Host: ^(?!www\.)(.+\.mobi)$
RewriteRule (.*) http(?1s)\://www.$2$3 [RP]
__________________ Regards,
Anton
|
| Back to Top |
|
| |
morich Newbie

Joined: 25 April 2010 Location: United Kingdom
Online Status: Offline Posts: 15
|
| Posted: 28 May 2010 at 1:01am | IP Logged
|
|
|
Hi thanks the Redirecting www version to non-www:
works ok but i did notice that i need to stop the quary string ie: http://mysite.mobi/newpage.htm?ArdSI=2a2f390a16e0 only want this http://mysite.mobi/newpage.htm
[ISAPI_Rewrite]
RewriteCond %HTTPS .*(on)?.*
RewriteCond Host: www\.(.+\.mobi)
RewriteRule (.*) http(?1s)\://$2$3 [RP]
and this one can you just look at again for me as i need to stop ? quary string and also this is a .co.uk site
And as for existing non-www to www rule, please try the following:
[ISAPI_Rewrite]
RewriteCond %HTTPS .*(on)?.*
RewriteCond Host: ^(?!www\.)(.+\.co\.uk)$
RewriteRule (.*) http(?1s)\://www.$2$3 [RP]
many thanks for your great help on this gary
|
| Back to Top |
|
| |
Anton Admin Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 10489
|
| Posted: 28 May 2010 at 4:04am | IP Logged
|
|
|
To stop query string, please try to use this:
[ISAPI_Rewrite]
RewriteCond %HTTPS .*(on)?.*
RewriteCond Host: ^(?!www\.)(.+\.co\.uk)$
RewriteRule (.*?)(?:\?.+)? http(?1s)\://www.$2$3 [RP]
__________________ Regards,
Anton
|
| Back to Top |
|
| |
morich Newbie

Joined: 25 April 2010 Location: United Kingdom
Online Status: Offline Posts: 15
|
| Posted: 28 May 2010 at 6:59am | IP Logged
|
|
|
Hi works ok when you use this http://mysite.co.uk/one/two.htm?ArdSI=2a2f396967c7706d5d172ac64e0a16e0 stops stop query string ok thanks
BUT WHEN SOMEONE USES http://www.mysite.co.uk/one/two.htm?ArdSI=2a2f396967c7706d5d172ac64e0a16e0
it does not work sorry
|
| Back to Top |
|
| |
Anton Admin Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 10489
|
| Posted: 28 May 2010 at 7:14am | IP Logged
|
|
|
Ooops, sorry, I've made a mistake. It should be like this:
[ISAPI_Rewrite]
RewriteCond %HTTPS .*(on)?.*
RewriteCond Host: ^(.+\.co\.uk)$
RewriteRule (.*?)(?:\?.+)? http(?1s)\://$2$3 [R]
RewriteCond %HTTPS .*(on)?.*
RewriteCond Host: ^(?!www\.)(.+\.co\.uk)$
RewriteRule (.*) http(?1s)\://www.$2$3 [RP]
__________________ Regards,
Anton
|
| Back to Top |
|
| |
morich Newbie

Joined: 25 April 2010 Location: United Kingdom
Online Status: Offline Posts: 15
|
| Posted: 31 May 2010 at 4:18am | IP Logged
|
|
|
hi do i use all this or can you just stop query string if someone comes in on the www side also i dont want asap
[ISAPI_Rewrite]
RewriteCond %HTTPS .*(on)?.*
RewriteCond Host: ^(.+\.co\.uk)$
RewriteRule (.*?)(?:\?.+)? http(?1s)\://$2$3 [R]
RewriteCond %HTTPS .*(on)?.*
RewriteCond Host: ^(?!www\.)(.+\.co\.uk)$
RewriteRule (.*) http(?1s)\://www.$2$3 [RP]
|
| Back to Top |
|
| |
Anton Admin Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 10489
|
| Posted: 31 May 2010 at 8:08am | IP Logged
|
|
|
Let me explain:
this part
RewriteCond %HTTPS .*(on)?.*
RewriteCond Host: ^(.+\.co\.uk)$
RewriteRule (.*?)(?:\?.+)? http(?1s)\://$2$3 [R]
redirects requested URL with query string to the same URL but WITHOUT query string.
this part
RewriteCond %HTTPS .*(on)?.*
RewriteCond Host: ^(?!www\.)(.+\.co\.uk)$
RewriteRule (.*) http(?1s)\://www.$2$3 [RP]
redirects non-www requests to www
Is that what you want?
__________________ Regards,
Anton
|
| Back to Top |
|
| |