Koozali.org: home of the SME Server

Problems with .htaccess

Offline ElFroggio

  • *
  • 262
  • +0/-0
Problems with .htaccess
« on: November 18, 2014, 09:36:06 PM »
Hi,

I trying to follow: http://wiki.contribs.org/Htaccess. I want to change the domain name from abc123.com to www.abc123.com. The problem is that it doesn't work for me. [I must be doing something wrong, but I don't know what] ABC123.com is a testing ground. I created a domain abc123.com [pointing to ibay: testing] with "Domain DNS servers: Resolve locally" and it works.

* I have created the nano -w 50AddSecureIbayFolder and I added:

Code: [Select]
<Directory /home/e-smith/files/ibays/testing/html>
Options +FollowSymlinks
RewriteEngine on

RewriteCond %HTTP_HOST ^abc123\.com$ [NC]
RewriteRule ^(.*)$ http://www.abc123.com/$1 [L,R=301]
</directory>

and then

Code: [Select]
expand-template /etc/httpd/conf/httpd.conf
service httpd-e-smith restart

I do see that code in the:
Code: [Select]
/etc/httpd/conf/httpd.conf but it's in a separate area, toward the beginning (line 288) but the virtual hosts for abc123.com starts on line 760.

BTW, abc123.com is strictly HTML, no php, just html files

Thanks

Syv

guest22

Re: Problems with .htaccess
« Reply #1 on: November 19, 2014, 12:10:46 AM »
I want to change the domain name from abc123.com to www.abc123.com.

The way to do that is to reconfigure your server via the console application. And maybe you want to check your DNS records for your domain to see if it accepts all domains related to or is very specific about the domain. I hardly think any .htaccess file has anything to do with what you want to achieve.

Offline ElFroggio

  • *
  • 262
  • +0/-0
Re: Problems with .htaccess
« Reply #2 on: November 19, 2014, 12:45:18 AM »
The way to do that is to reconfigure your server via the console application.

Sorry but I do not understand. What is the console application? Can you explain further.

The DNS is provided by SME (internal network).

Thanks

Syv

Offline TerryF

  • grumpy old man
  • *
  • 1,826
  • +6/-0
Re: Problems with .htaccess
« Reply #3 on: November 19, 2014, 01:37:04 AM »
Console as in Login to server from the cli as admin or as root and type console at the command prompt..

See wiki Chapter 6 - http://wiki.contribs.org/SME_Server:Documentation:Administration_Manual:Chapter6

Item 2 - Configure this server
--
qui scribit bis legit

Offline ElFroggio

  • *
  • 262
  • +0/-0
Re: Problems with .htaccess
« Reply #4 on: November 19, 2014, 06:15:21 AM »
Further info.

I got it working following the http://wiki.contribs.org/Htaccess#Using_a_.htaccess_file_to_configure_htaccess_requirements_-_not_recommended.

Somehow when I use the recommended fragments. It doesn't work. So I don't think that it's solved but I have found a work around.

Thanks

Syv