Koozali.org: home of the SME Server

Question on htaccess on ibays

Offline dadou

  • **
  • 47
  • +0/-0
Question on htaccess on ibays
« on: July 18, 2023, 11:59:35 AM »
Hello,

Hope you are all well ! Little question probably my mistake, but I don't get it. I am on 10.1.

I activated the AllowOverride=All on the ibay.
The .htaccess file is now well interpreted.

I try to redirect traffic of domain.com to www.domain.com :

Code: [Select]
Options +FollowSymLinks -Indexes
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

But I get an Internal Server Error and in the Logs :
/.htaccess: Either all Options must start with + or -, or no Option may.

When I only leave first line in the htaccess it's fine :
Code: [Select]
Options +FollowSymLinks -Indexes
But as soon as I put the rewrite conditions it's in error.
An idea ?

Thanks

Dadou
« Last Edit: July 18, 2023, 12:01:27 PM by dadou »

Offline Jean-Philippe Pialasse

  • *
  • 2,774
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Question on htaccess on ibays
« Reply #1 on: July 18, 2023, 02:31:11 PM »
what editor do you uses ?

Offline dadou

  • **
  • 47
  • +0/-0
Re: Question on htaccess on ibays
« Reply #2 on: July 18, 2023, 05:47:24 PM »
Good guess. I didn't thought about that.
I use Notepad++ on Windows, and the \r is wrong (or probably LF & CRLF pb).
When I edit with vi on command line it's not ok. I changed it through vi and now it's fine.

Thanks Jean-Philippe. Sorry not to have thought about it.

Dadou
« Last Edit: July 18, 2023, 06:00:02 PM by dadou »

Online TerryF

  • grumpy old man
  • *
  • 1,826
  • +6/-0
Re: Question on htaccess on ibays
« Reply #3 on: July 18, 2023, 10:03:54 PM »
Damn, notepad++ is all I use or try and use..need to be a little careful, nano for cli tasks
--
qui scribit bis legit

Offline Jean-Philippe Pialasse

  • *
  • 2,774
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Question on htaccess on ibays
« Reply #4 on: July 19, 2023, 02:19:45 PM »
good news !

notepad++ was my best editor when i was under windows years back.  you should be able to configure the line separator to fit. Running it with wine under linux is so slow to start that it is a no go.

I miss its versatility and numerous plugins.