Welcome Guest, Not a member yet? Register   Sign In
addon domain htaccess
#11

[eluser]marinaccio[/eluser]
I take it that it worked. Awesome, glad I could help. Have a good weekend!
#12

[eluser]skybreeze[/eluser]
I'm trying to install a StoreStacker store in an addon domain on a Bluehost.com server. I've tried using code from both InsiteFX and marinaccio listed above and still getting a 500 error.

Here is the code I've used, successfully, on a VPS and primary domain at another web host:

Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteRule ^images(.*)$ - [L]
RewriteRule ^sitemap(.*)$ - [L]
RewriteRule ^smgenerator(.*)$ - [L]
RewriteRule ^articles(.*)$ - [L]
RewriteRule ^blog(.*)$ - [L]
RewriteCond %{REQUEST_URI} ^[^\.]*[^/]$
RewriteRule (.+) $1/ [R,L]
RewriteCond %{REQUEST_URI} !^/index\.php|^/admin|^/click\.php|^/templates/|^/install\.php|^/robots\.txt$|^/favicon\.ico
RewriteRule (.+) index.php?req=$1&%{QUERY_STRING}

Error message from IE8 browser:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

Here is the cPanel error logs if this will help:

[Sun Oct 18 14:09:35 2009] [error] [client 206.116.150.64] Usage: file [-bcikLhnNsvz] [-f namefile] [-F separator] [-m magicfiles] file..., referer: http://mediatonicpr.com/
[Sun Oct 18 14:09:35 2009] [error] [client 206.116.150.64] Usage: file [-bcikLhnNsvz] [-f namefile] [-F separator] [-m magicfiles] file..., referer: http://mediatonicpr.com/
[Sun Oct 18 14:09:35 2009] [error] [client 206.116.150.64] file -C -m magicfiles, referer: http://mediatonicpr.com/
[Sun Oct 18 14:09:35 2009] [error] [client 206.116.150.64] Try `file --help' for more information., referer: http://mediatonicpr.com/
[Sun Oct 18 14:09:35 2009] [error] [client 206.116.150.64] file -C -m magicfiles, referer: http://mediatonicpr.com/
[Sun Oct 18 14:09:35 2009] [error] [client 206.116.150.64] Try `file --help' for more information., referer: http://mediatonicpr.com/
[Sun Oct 18 14:09:35 2009] [error] [client 206.116.150.64] Usage: file [-bcikLhnNsvz] [-f namefile] [-F separator] [-m magicfiles] file..., referer: http://mediatonicpr.com/
[Sun Oct 18 14:09:35 2009] [error] [client 206.116.150.64] file -C -m magicfiles, referer: http://mediatonicpr.com/
[Sun Oct 18 14:09:35 2009] [error] [client 206.116.150.64] Try `file --help' for more information., referer: http://mediatonicpr.com/
[Sun Oct 18 14:09:35 2009] [error] [client 206.116.150.64] Usage: file [-bcikLhnNsvz] [-f namefile] [-F separator] [-m magicfiles] file..., referer: http://mediatonicpr.com/
[Sun Oct 18 14:09:35 2009] [error] [client 206.116.150.64] file -C -m magicfiles, referer: http://mediatonicpr.com/
[Sun Oct 18 14:09:35 2009] [error] [client 206.116.150.64] Try `file --help' for more information., referer: http://mediatonicpr.com/


Can someone help?
#13

[eluser]skybreeze[/eluser]
I fixed my problem -- the same code that was used with my previous web host worked with the addon domain after I setup a new database and imported the old database files into the new database via cPanel-->phpMyAdmin. Any name and password changes in new database will have to be entered in the old/transferred sql text file and any related config.php file.

Again, here is the code I used before on a VPS/primary domain and now on an addon domain at Bluehost.com:

Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteRule ^images(.*)$ - [L]
RewriteRule ^sitemap(.*)$ - [L]
RewriteRule ^smgenerator(.*)$ - [L]
RewriteRule ^articles(.*)$ - [L]
RewriteRule ^blog(.*)$ - [L]
RewriteCond %{REQUEST_URI} ^[^\.]*[^/]$
RewriteRule (.+) $1/ [R,L]
RewriteCond %{REQUEST_URI} !^/index\.php|^/admin|^/click\.php|^/templates/|^/install\.php|^/robots\.txt$|^/favicon\.ico
RewriteRule (.+) index.php?req=$1&%{QUERY_STRING}

Regards,
#14

[eluser]Unknown[/eluser]
marinaccio! you saved me man, and I'm grateful
#15

[eluser]Unknown[/eluser]
[quote author="InsiteFX" date="1255106557"]Here is what you need to put in you htaccess file in the directory that houses your add-on domain ie. www.the-hosting-domain.com/add-on/ :
Code:

Code:
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine OnRewriteCond %{HTTP_HOST} ^addondomain\.com [NC]
RewriteRule ^(.*) http://www.addondomain.com/$1 [R=301,L]

RewriteCond %{HTTP_HOST} ^www.addondomain.the-hosting-domain\.com
RewriteRule ^(.*)$ http://www.addondomain.com/$1 [R=permanent,L]

RewriteCond %{HTTP_HOST} ^addondomain.the-hosting-domain\.com
RewriteRule ^(.*)$ http://www.addondomain.com/$1 [R=permanent,L]
</IfModule>



Hi ,

I have this problem...I have tried it ...and it doesn't work. Any suggestions

And add this to the .htaccess file in the root domain: ie. www.thehostingdomain.com
Code:

Code:
Options +FollowSymlinks
RewriteEngine OnRedirect /addondomain http://www.addondomain.com

And another way:

Code:
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?addondomain\.mydomain\.com [NC,OR]
RewriteCond %{HTTP_HOST} ^!www\.addondomain\.com [NC]
RewriteRule ^(.*)$ http://www.addondomain.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^addondomain.com [NC]
RewriteRule ^(.*)$ http://www.addondomain.com/$1 [R=301,L]
RewriteCond %{REQUEST_URI} ^/addondomain($|/.*$)
RewriteRule ^.* http://www.addondomain.com%1 [R=301,L]
</IfModule>

Enjoy
InsiteFX[/quote]
#16

[eluser]Jesus TG[/eluser]
[quote author="marinaccio" date="1255159384"]Who is your web host? I have several sites on BlueHost, all addons, using a setup similar to this:

.htaccess

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|img|css|js|robots\.txt)
RewriteCond $1 !^(index\.php|application/views/|robots\.txt|install|favicon\.ico|documents)
RewriteRule ^(.+)$ index.php?$1 [L]

config.php

$config['base_url'] = "http://www.addondomainnamehere.com/";
$config['index_page'] = "";

Hope that helps, if not, just post back, CI tends to have some really sharp people lurking these forums!

-Joe[/quote]


Hello marinaccio,

I know your code works fine inside an addon domain/folder with codeigniter and bluehost. I want to do a similar thing. But I have other problem because I have other codeigniter installation in the main domain at /public_html, and it looks like the main .htaccess is blocking the acces to the addon domain. I would like to know if you has some experience with this issue.

This is the main htaccess file, the website is cielex.com and we are using https in all website:

RewriteEngine on


RewriteCond $1 !^(index\.php|uploads|assets|blog|blog.|robots\.txt|cron_job\.php)
RewriteRule ^(.*)$ /index.php/$1 [L]


RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}




Theme © iAndrew 2016 - Forum software by © MyBB