| Author |
|
webdevsp Newbie

Joined: 04 December 2008 Location: United Kingdom
Online Status: Offline Posts: 10
|
| Posted: 23 October 2009 at 8:22pm | IP Logged
|
|
|
Hi
Our hosts server has ISAPI_Rewrite v3 installed.
Our site (www.silverhouse property.com) has cannonisation issues)
I'm new to this but understand I need to put a .htaccess file in place - there is not one there at the moment.
Would be much obliged if anyone advise on lines required in file?
Also any other tips ...maybe directing www.domain.com/index.php to www.domain.com would be needed?
Many Thanks!
__________________ Andy - Webdev
|
| Back to Top |
|
| |
Anton Admin Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 10520
|
| Posted: 26 October 2009 at 5:15am | IP Logged
|
|
|
"Would be much obliged if anyone advise on lines required in file?" - could you please specify what you want to achieve using ISAPI_Rewrite.
"directing www.domain.com/index.php to www.domain.com":
RewriteBase /
RewriteRule ^index\.php$ / [NC,R=301,L]
__________________ Regards,
Anton
|
| Back to Top |
|
| |
webdevsp Newbie

Joined: 04 December 2008 Location: United Kingdom
Online Status: Offline Posts: 10
|
| Posted: 26 October 2009 at 6:45am | IP Logged
|
|
|
Hi Yes sorry I wanted to do 2 things:-
1. Direct any requests for http://domain.com to http://www.domain.com
2. direct any requests for www.domain.com/index.php to www.domain.com
__________________ Andy - Webdev
|
| Back to Top |
|
| |
webdevsp Newbie

Joined: 04 December 2008 Location: United Kingdom
Online Status: Offline Posts: 10
|
| Posted: 26 October 2009 at 7:35am | IP Logged
|
|
|
This is the current contents of .htaccess
RewriteEngine on Options +FollowSymLinks RewriteCond %{THE_REQUEST} ^.*/index\.php RewriteRule ^(.*)index.php$ http://www.silverhou seproperty.com/$1 [R=301,L]
RewriteBase / RewriteRule ^index\.php$ / [NC,R=301,L]
__________________ Andy - Webdev
|
| Back to Top |
|
| |
webdevsp Newbie

Joined: 04 December 2008 Location: United Kingdom
Online Status: Offline Posts: 10
|
| Posted: 26 October 2009 at 8:17am | IP Logged
|
|
|
I've now got....
RewriteEngine on Options +FollowSymLinks RewriteCond %{THE_REQUEST} ^.*/index\.php RewriteRule ^(.*)index.php$ http://www.silverh ouseproperty.com/$1 [R=301,L]
RewriteBase / RewriteRule ^index\.php$ / [NC,R=301,L]
RewriteCond %{HTTP_HOST} ^silverh ouseproperty.com RewriteRule (.*) http://www.silverh ouseproperty.com/$1 [R=301,L]
Think I have some redundent lines but it seems to be working!
__________________ Andy - Webdev
|
| Back to Top |
|
| |
Anton Admin Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 10520
|
| Posted: 26 October 2009 at 8:21am | IP Logged
|
|
|
Please try to use the following config:
RewriteBase /
RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP:Host} ^(?!www\.)(.+)$ [NC]
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http(?%1s)://www.%2%3 [R=301,L]
RewriteRule ^index\.php$ / [NC,R=301,L]
__________________ Regards,
Anton
|
| Back to Top |
|
| |
webdevsp Newbie

Joined: 04 December 2008 Location: United Kingdom
Online Status: Offline Posts: 10
|
| Posted: 26 October 2009 at 6:57pm | IP Logged
|
|
|
Hi Anton
I tried what you advised & it all stopped working...expect I was meant to replace some variable with the real domain name?
I put it back to as below and working again...but expect this is an inefficient way to do it? Thanks
RewriteEngine on Options +FollowSymLinks RewriteCond %{THE_REQUEST} ^.*/index\.php RewriteRule ^(.*)index.php$ http://www.silverh ouseproperty.com/$1 [R=301,L]
RewriteBase / RewriteRule ^index\.php$ / [NC,R=301,L]
RewriteCond %{HTTP_HOST} ^silverh ouseproperty.com RewriteRule (.*) http://www.silverh ouseproperty.com/$1 [R=301,L]
__________________ Andy - Webdev
|
| Back to Top |
|
| |
Anton Admin Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 10520
|
| Posted: 27 October 2009 at 6:02am | IP Logged
|
|
|
Could you please explain what should be in the host section of the URL instead of space?
And please try the following config:
RewriteBase /
RewriteCond %{HTTP_HOST} ^silverh ouseproperty.com
RewriteRule (.*) http://www.silverh ouseproperty.com/$1 [R=301,L]
RewriteRule ^index\.php$ / [NC,R=301,L]
RewriteRule ^(.*)index\.php$ http://www.silverh ouseproperty.com/$1 [NC,R=301,L]
__________________ Regards,
Anton
|
| Back to Top |
|
| |