subdomain

htaccess mod rewrite $_GET to variables with slashes

孤街醉人 提交于 2019-11-30 09:53:30
I would like to rewrite URL's with htaccess to better readable URL's and use the $_GET variable in PHP I sometimes make use of a subdomain so it has to work with and without. Also are the variables not necessary in the url. I take a maximum of 3 variables in the URL the URL sub.mydomain.com/page/a/1/b/2/c/3 should lead to sub.mydomain.com/page.php?a=1&b=2&c=3 and the url sub.mydomain.com/a/1/b/2/c/3 should lead to sub.mydomain.com/index.php?a=1&b=2&c=3 where $_GET['a'] = 1 I came up with this after searching and trying a lot RewriteEngine on RewriteRule ([^/]+)\.domain.com/([^/]+)/([^/]+)/([^/

htaccess Rewrite Rule for subdomain to page

跟風遠走 提交于 2019-11-30 09:05:26
问题 Currently I have a page residing at: http://www.example.com/site/page In my htaccess I have the current rule: RewriteRule ^site/(.*)$ retailer.php?linklabel=$1 [QSA] What would the rule look like to have the URL for that page become it's own subdomain: http://page.example.com Thanks for any help!! So far I have tried the following rule which hasn't worked: RewriteRule http://(.*)$.example.com retailer.php?linklabel=$1 [QSA] Maybe I need to do something in cpanel first regarding a wildcard

How to create this type of subdomain on the fly like Blogger.com

喜你入骨 提交于 2019-11-30 08:30:11
问题 Sometime ago I asked this question and I was told that the entry has to be made in DNS etc. I was not sure whether all this is really required or not. The kind of feature that I am looking for is shown in the screenshot below: As you can see blogger lets the user choose the subdomain for his blog. How can we achieve this? I am basically developing in asp.net C#. How can I allow my users to choose subdomains like this once I have my top level domain. Currently I am developing on localhost. 回答1

Subdomains in a Rails 4 app

时光怂恿深爱的人放手 提交于 2019-11-30 07:45:44
Today I came across a rather weird phenomenon. When developing a Rails app in which every user has his own subdomain, and trying to use Devise to do it, I encountered that also subdomains not registered whatsoever would route to the root page. So, for example, even if there was no (explicit) subdomain, it would route me to the main application page. Maybe this has to do with my particular setup? I also tried with a new Rails project, but I got the same result. Anyone able to clarify this for me? Railscasts didn't do the trick. Also, right now I'm using WEBrick, even though that's not what I'll

Extract Google Search Results

青春壹個敷衍的年華 提交于 2019-11-30 07:39:16
I would like to periodically check what sub-domains are being listed by Google. To obtain list of sub-domains, I type 'site:example.com' in Google search box - this lists all the sub-domain results (over 20 pages for our domain). What is the best way to extract only the URL of the addresses returned by the 'site:example.com' search? I was thinking of writing a little python script that will do the above search and regex the URLs from the search results (repeat on all result pages). Is this a good start? Could there be a better methodology? Cheers. Regex is a bad idea for parsing HTML. It's

ASP.NET MVC Subdomains

元气小坏坏 提交于 2019-11-30 07:03:37
I have hosting and domain like that: www.EXAMPLE.com I've created few subdomains like that: www.PAGE1.EXAMPLE.com www.PAGE2.EXAMPLE.com www.PAGE3.EXAMPLE.com ... etc... All of these subdomains point to one and the same ASP.NET MVC 5 Application. I want to make system which will load data depending of subdomain. Example: I have Article object which could be a Auto Review or Game review or Book Review etc... I would like to www.auto.example.com load data where type of article is Auto, to www.book.example.com I would like to load data with type Book etc. There will be many types of the pages.

Access root domain's localStorage from subdomain

橙三吉。 提交于 2019-11-30 07:01:17
问题 EDIT: For the sake of simplicity: I've got a simple UserJS script (FF/Chrome: Greasemonkey, Opera: built-in) that fixes some issues on website I'm using quite often. The problem is that I need to store some data between different requests. My first attempt was LocalStorage but it fail when it came to work with subdomains: www.domain.com and subdomain.domain.com (unfortunately root-domain is subdomain in fact - stupid www ) . I need to be able to access some data source that would be available

Creating subdomains in Amazon EC2

▼魔方 西西 提交于 2019-11-30 06:14:32
问题 How can I create subdomains on Amazon EC2? Is adding virtual host in httpd.conf is enough.. or any other changes also needs to be done? Thanks 回答1: Depends on your server software. But as you mention httpd.conf, chances are good that you run Apache on a Linux distribution. If that's the case then yes, adding a virtual host is enough. Here is one way of doing it: Purchase a domain. If you have one, skip this, we'll take example.com for this example. Find the external IP or DNS for your EC2

Redirect subdomain into top-level domain's folder

一个人想着一个人 提交于 2019-11-30 05:50:49
问题 Here's what I'm trying to do. When you type m.example.com I want users to be redirected to example.com/m/ but I would like the url in the address bar to remain m.example.com if possible. 回答1: You can do that with mod_rewrite and mod_proxy: RewriteEngine on RewriteCond %{HTTP_HOST} ^m\.example\.com$ RewriteRule ^ http://example.com/m%{REQUEST_URI} [L,P] 回答2: Just set the subdomain's root dir to example.com/m/. Then there is no redirection. 来源: https://stackoverflow.com/questions/1456956

How to run nodejs application in apache server

廉价感情. 提交于 2019-11-30 05:41:50
I would like to run my nodejs application via subdomain on apache server. I created subdomain of primary domain in cpanel. My project having more than 3 subdomains and all subdomains points different nodejs application. Subdomain redirects me in proper folder but when I run an application via subdomain in browser, it does not run node application on apache server. It displays folder lists of project only. I refer following link for reference. http://www.codingtricks.biz/run-nodejs-application-apache/ Running Node.js in apache? Project Directory : /home/abc/public_html/node My primary domain is