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

[eluser]melpuggi[/eluser]
Hello,

I installed some sites with addon domain and using with CI them, but addon domains cannot work rewrite rules,

.htaccess content;

RewriteEngine on
RewriteBase /
RewriteCond $1 !^(index\.php|folders)
RewriteRule ^(.*)$ index.php/$1 [L]

I tried /www/site_folder or /site_folder etc...

What is the error, me or server?
#2

[eluser]Ruben Müller[/eluser]
Check this one, is it really the base?
Code:
RewriteBase /

And instead of this:
Code:
RewriteRule ^(.*)$ index.php/$1 [L]
this:
Code:
RewriteRule ^(.*)$ ./index.php/$1 [L]
or:
Code:
RewriteRule ^(.*)$ index.php?$1 [L]
or:
Code:
RewriteRule ^(.*)$ ./index.php?$1 [L]

Is mod_rewrite activated? Check it with a more simple .htaccess!
#3

[eluser]melpuggi[/eluser]
Let me draw a diagram

/public_html (this is the main site and has an htaccess with contents)


/public_html/subdomain (this is the subdomain and I am using it with codeigniter)

my subdomain htaccess content:

Code:
RewriteEngine On
RewriteBase /subdomain/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]

I tried it with some changes. But error gives or does not work.
Thanks for your reply.
#4

[eluser]Pramod[/eluser]
I have also problem in addon domain. It shows 500 internal error. Please help me to set up the add on domain htacess for codeIgnitor to hide index.php from url.
#5

[eluser]InsiteFX[/eluser]
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>

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
#6

[eluser]Pramod[/eluser]
I am having problem again with codeignitor and htacess. INSITEFX please help me for following domains.

Following are the deatils:
Main domain:www.pramodpoudel.com
Addon domain in folder inside public_html : planmakers.com.np
Addon domain name : www.planmakers.com.np

Thanks in advance
#7

[eluser]InsiteFX[/eluser]
Code:
RewriteBase /public_html/

RewriteBase /public_html/addon_domain/

Enjoy
InsiteFX
#8

[eluser]Pramod[/eluser]
I have done as you told. But could solve the problem. I have some problem in server too. So, could not figure out the error whether of server or of htacess.

Please help me.
#9

[eluser]marinaccio[/eluser]
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
#10

[eluser]Pramod[/eluser]
Thanks marinaccio!!!!!!!!!!!




Theme © iAndrew 2016 - Forum software by © MyBB