Koozali.org: home of the SME Server

Redirect

Offline ElFroggio

  • *
  • 262
  • +0/-0
Redirect
« 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

Offline piran

  • *****
  • 502
  • +0/-0
Re: Redirect
« Reply #1 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;~)]
« Last Edit: October 20, 2008, 07:53:02 PM by piran »

Offline piran

  • *****
  • 502
  • +0/-0
Re: Redirect
« Reply #2 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]

Offline ElFroggio

  • *
  • 262
  • +0/-0
Re: Redirect
« Reply #3 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

Offline piran

  • *****
  • 502
  • +0/-0
Re: Redirect
« Reply #4 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;~)

Offline mmccarn

  • *
  • 2,652
  • +10/-0
Re: Redirect
« Reply #5 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?)


Offline ilko

  • 4
  • +0/-0
    • Стара Загора
Re: Redirect
« Reply #6 on: April 13, 2009, 09:00:36 PM »
Thanks for this post!
www.pc-tm.eu - Библиотечен софтуер