subdomain

How to use wildcard subdomain in a folder on server public_html/subdomain

帅比萌擦擦* 提交于 2019-12-12 01:26:33
问题 I have a wildcard subdomain in a folder public_html/subdomain on my server. I am using php script as follows Just to show you what I am doing on the page: <?php $subdomain = explode('.', $_SERVER['HTTP_HOST']); $subdomain = strtolower(array_shift($subdomain)); echo ucwords(str_replace('-', ' ', $subdomain)); ?> The problem is when example.domain.co.uk is typed in it returns the top level public_html/index.php file and not the public_html/subdomain/index.php I had this working before but I may

.htaccess redirect any subdomain *.domain1.com to *.domain2.com

╄→гoц情女王★ 提交于 2019-12-12 01:08:24
问题 I want to redirect every subdomains of domain1.com to domain2.com foo.domain1.com -> foo.domain2.com baz.domain1.com -> baz.domain2.com bar.domain1.com -> bar.domain2.com etc 回答1: https://stackoverflow.com/a/8046069/2024688 RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.domain1\.com$ [NC] RewriteRule ^(.*)$ http://%1%2.domain2.com/$1 [L,R] 来源: https://stackoverflow.com/questions/17141021/htaccess-redirect-any-subdomain-domain1-com-to-domain2-com

remove index.php of codeigniter subdomains

假装没事ソ 提交于 2019-12-11 19:58:06
问题 this is my directory: -root -CI -application -system -sub-domain1 (codeigniter ) -application -sub-domain2 (codeigniter ) -application -www -folder1 -folder2 ..... -folder10 -sub-domain1 -index.php (used for codeigniter) -sub-domain2 -index.php (used for codeigniter) -file1.php -file2.php -file3.php ..... -file10.php -index.php (used for codeigniter) - .htaccess in my application/config/config.php is: $config['index_page'] = ""; I didn't have the sub-domain1 and sub-domain2 and I wanted to

How to make a subdomain ajax call with jQuery (without iFrames)

偶尔善良 提交于 2019-12-11 19:47:30
问题 site.com/api/index.php is where I need the ajax request to go. From site.com/sub/ the request works perfectly but sub.site.com is sending the request to sub.site.com/api/index.php which obviously does not exist... I've Google and StackOverflowed the hell out of the question, but can't seem to find an answer that works. Code: var jQuery_ajax = { url: "site.com/api/index.php", type: "POST", data: $.param(urlData), dataType: "json" } var request = $.ajax(jQuery_ajax); The most common answer was

.htaccess redirect to subdomain based on query string parameter

大憨熊 提交于 2019-12-11 19:21:53
问题 I need to set up a redirection to sub domain based on query string. Example: http://example.com/message.php?id=subdomain to http://subdomain.example.com/message.php Is this possible in .htaccess? 回答1: This will redirect all the URLs with QUERY_STRING like id=subdomain and file message.php to the appropriate subdomain: RewriteEngine on RewriteCond %{HTTP_HOST} ^(www\.)?example.com$ [NC] RewriteCond %{QUERY_STRING} ^id=(.*)$ RewriteRule message.php http://%1.example.com/message.php? [R=301,L]

Issue with subdomains and htaccess for SEO

戏子无情 提交于 2019-12-11 18:42:16
问题 I would like to change urls from: http://subdomain.domain.com/page/ to http://subdomain.domain.com/?page=pagename and also: http://domain.com/page/ to http://domain.com/?page=pagename though haven't had much success. Here is my htaccess file so far [updated] Options +FollowSymlinks -MultiViews RewriteEngine On RewriteBase / # Remove 'www' RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L] # Add slashes RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST

Maintain the same project within multiple sub-domains

纵然是瞬间 提交于 2019-12-11 17:46:36
问题 I'm facing a situation and I'd like to have some feedback/guidance about the best approach. I have a big project developed with PHP and CodeIgniter working as a SaaS solution for more than a year and it's working perfectly. A new client about two months ago asked me if he can use my software but with some new features developed specifically for him. I said yes and created a sub-domain with the base structure of my main project along with the new developments he asked for. What happens is that

mod_rewrite is ignoring rules in subdirectories

ぃ、小莉子 提交于 2019-12-11 17:11:12
问题 Wanted rewrite behaviour (internal rewrite!) http://<subdomain>.domain.tld/<path> -> /<subdomain>/<path> http://www.domain.tld/path/file.php -> /www/path/file.php http://project.domain-tld/index.php -> /project/index.php Folder structure: / root .htaccess /www www.domain.tld index.php /www file.php /foo /bar file.php /project project.domain.tld index.php someRandomFiles /somesubdomain somesubdomain.domain.tld index.php someRandomFiles /anothersubdomain anothersubdomain.domain.tld index.php

Cookie Free Domain Doesn't work

纵饮孤独 提交于 2019-12-11 16:46:57
问题 I was following this tutorial: http://www.xpertdeveloper.com/2011/07/wordpress-cookie-free-domain/ So, I created (CPANEL) the subdomain static.artswr.com and redirected it to artswr.com/wp-content/ I edited and add the following in the end of the wp-config file: define("WP_CONTENT_URL", "http://static.artswr.com"); define("COOKIE_DOMAIN", "www.artswr.com"); I am loading everything with <?php bloginfo('template_directory'); ?> but its not working, also I'm getting 404 errors when I try to find

mvc3 forms authentication across sub-domains in single application

删除回忆录丶 提交于 2019-12-11 16:14:41
问题 Similar to this question: Single Sign-on - MVC3 and Webforms I have a MVC3 application with custom routing that takes the first part of the sub-domain URL and uses it as a variable. So, for example, test1.mydomain.com gives my controllers the variable subdomain a value of test1. If we type in test2.mydomain.com, then the controllers receive "test2". The problem is with authentication (using built-in forms auth). If I log on while on test1.mydomain.com and then navigate to test2.mydomain.com,