Tag Archives: dom

issue in redirecting 2 domains in one server

Questions: I have 2 domains and both are set on one server and when you open each of them , the same website from the same server opens . now i want to redirect one of them to another . for example I have www.first.com and www.second.com both on one server , and I want… Read More »

How make PHP session work using subdomain and AJAX?

Questions: I’m working in a PHP project that uses subdomains, sessions and Ajax. But unfortunately I can’t make it work! I’ll try explain: Let’s assume that I’m at this domain: app.mysite.com/index.php At this domain, I have a form that performs an Ajax request to mysite.com/functions/execute.php (without any subdomain) In the first line of execute.php, I… Read More »

Apache Config with Wildcard/Non-Wildcard Subdomain Mix

Questions: I have the domain, we’ll call it “mydomain.com” and I want the following virtual hosts set up to resolve in the following way: mydomain.com / www.mydomain.com to point to /var/www/ dev.mydomain.com to point to /var/www/dev/ *.mydomain.com (all other subdomains) to point to /var/www/old My apache configuration is currently set up as: NameVirtualHost <VirtualHost… Read More »

Simple .htaccess subdomain rewrite

Questions: I know there is a lot of questions on here about this… but right now I feel like a deer stunned by oncoming headlights… I just don’t know where to start and which option to choose. My requirements are simple. User goes to http://application.domain.com or http://www.application.domain.com and the real location of these files is… Read More »

force www in htaccess except all subdomains

Questions: my force www htaccess code is : RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] but i have problems with subdomains ex: abcdef.example.com ====> www.abcdef.example.com and i want to edit code to be worked like these: example.com ===> www.example.com abcdefg.example.com ===> abcdefg.example.com example.co.uk ===> www.example.co.uk abcd.example.co.uk ===> abcd.example.co.uk Answers: RewriteEngine On RewriteCond %{HTTP_HOST}… Read More »

Apache mod_proxy_uwsgi and unix domain sockets

Questions: I have a uwsgi server running for unix domain socket [uwsgi] … socket = /var/run/someuwsgi.sock socket = localhost:9987 … The mod_proxy_uwsgi is installed In apache config has that line: ProxyPass /some uwsgi://localhost:9987 And it is working. Question: what should be the apache config line to go through unix domain socket /var/run/someuwsgi.sock ? I tried… Read More »

htacces rewrite tld without changing subdomain or dirs

Questions: I am trying to rewrite the following url: the subdomain should match any subdomain. same for the TLD. both: http://car.example.com/ and http://cat.example.co.uk should be rewritten http://subdomain.example.com/some/dir to http://subdomain.example.nl/some/dir and http://example.com/some/dir to http://exampkle.nl/some/dir (also with www. adress) but my knowledge of htaccess and rewrite rules in general aren’t good enough for this 🙁 I hope… Read More »

Changing Cookie Domains

Questions: I use apache as a proxy to my application web server and would like to on the fly, change the domain name associated with a sessionid cookie. The cookie has a .company.com domain associated with it, and I would like using apache mod rewrite (or some similar module), transparently change the domain to app.company.com.… Read More »

A question about cross-domain (subdomain) ajax request

Questions: Let’s say I have the main page loaded from http://www.example.com/index.html. On that page there is js code that makes an ajax request to http://n1.example.com//echo?message=hello. When the response is received a div on the main page is updated with the response body. Will that work on all popular browsers? Edit: The obvious solution is to… Read More »