Koozali.org: home of the SME Server

Obsolete Releases => SME Server 7.x => Topic started by: ElFroggio on October 20, 2008, 05:41:40 AM

Title: Redirect
Post by: ElFroggio on October 20, 2008, 05:41:40 AM
Hi,

I have created a new iBay. My website works but the rewrite does not: I want all request to be redirected to www.

In .htaccess I have:

Code: [Select]
RewriteCond %{HTTP_HOST} !^www\. 
RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [R=301,L]

then I did:

Code: [Select]
db accounts setprop ibfoto-biz.dp6 AllowOverride All
expand-template /etc/httpd/conf/httpd.conf
/etc/rc.d/rc7.d/S86httpd-e-smith restart
chown -R www:www *

But the rewrite does not happens. How can I track down the problem?

Any suggestion will be appreciated
Title: Re: Redirect
Post by: piran on October 20, 2008, 07:48:35 PM
Code: [Select]
RewriteCond %{HTTP_HOST} !^www\. 
RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [R=301,L]

replace
'RewriteRule (.*)'
with
'RewriteRule ^(.*)'

[PostEdit: changed my mind;~)]
Title: Re: Redirect
Post by: piran on October 20, 2008, 07:58:37 PM
If that doesn't cut the mustard try cutting less corners.
Spell out the site in long hand ie drop the rewrite HOST:
Code: [Select]
RewriteCond %{HTTP_HOST} !^www\.myactualsite
RewriteRule ^(.*) http://www.myactualsite/$1 [R=301,L]
Title: Re: Redirect
Post by: ElFroggio on October 20, 2008, 11:14:40 PM
Just did and it still does not work. Here is the full listing:
Code: [Select]
<IfModule mod_rewrite.c> 
   RewriteEngine on 
   RewriteCond %{HTTP_HOST} !^www\.sritch\.com 
   RewriteRule ^(.*) http://www.sritch.com/$1 [R=301,L]
   RewriteCond %{REQUEST_FILENAME} !-f 
   RewriteCond %{REQUEST_FILENAME} !-d 
   RewriteCond %{REQUEST_URI} !=/favicon.ico 
   RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>

This is for drupal.
Then I expanded it with:
Code: [Select]
db accounts setprop ibfoto-biz.dp6 AllowOverride All
expand-template /etc/httpd/conf/httpd.conf
chown -R www:www *
chown -R www:www .htaccess

I must be doing something wrong or missing something, but I don't see it. I have checked all the http log files and it shows no error.

Thanks
Title: Re: Redirect
Post by: piran on October 20, 2008, 11:29:23 PM
I've always used 'O'n... (uppercase O)
RewriteEngine On

Maybe you need some Options? eg
Options +FollowSymLinks -MultiViews
RewriteEngine On

I don't know drupal at all. Found Joomla! to be
hazardous/tedious enough to then try out drupal.
Now I just try to keep things down to plain old
handwritten PHP/html hoping I don't get too lost.
Best of luck;~)
Title: Re: Redirect
Post by: mmccarn on October 23, 2008, 04:03:43 PM
Take a look at /etc/httpd/conf/httpd.conf and make sure the contents relating to your ibay make sense:
* allowoverride all
* executable content allowed in the folder you're expecting (default is <ibayname>/cgi-bin - where is your "index.php" located?)

Title: Re: Redirect
Post by: ilko on April 13, 2009, 09:00:36 PM
Thanks for this post!