Apache :: HTAccess Wildcard Subdomains

Jul 11, 2015

I have viewing the city names in my website like the following structure - [URL] ....

Here is the ,htaccess code - RewriteRule ^([^/]*)/([^/]*)/$ city.php?state=$1&city=$2 [NC]

But actually, I'm looking for to use wildcard subdomains that will rebuild the city names like the following structure-
city.mydomain.com/state/

I just need the htaccess rewrite code. 

View 1 Replies


ADVERTISEMENT

Wildcard DNS Subdomains Working, But Existing Subdomains Not

May 7, 2007

I've set up the affiliate manager from jrox.com for a client of mine. This includes the setup of wildcard DNS so that each affiliate can have username.clientssite.com and have it count their clicks - which works properly.

What isn't working properly is that he also has forums.hissite.com, which is loading the main website page instead of his forums. He is using cpanel to add the subdomain, and it isn't failing, so I'm not sure what's going on with it.

Here is the relative section from the httpd file.

Quote:

<VirtualHost 74.53.106.146>
ServerAlias residualvictory.com
ServerAlias *.residualvictory.com
ServerAdmin webmaster@residualvictory.com
DocumentRoot /home/residual/public_html
BytesLog domlogs/residualvictory.com-bytes_log
ServerName www.residualvictory.com

User residual
Group residual
CustomLog /usr/local/apache/domlogs/residualvictory.com combined
ScriptAlias /cgi-bin/ /home/residual/public_html/cgi-bin/
</VirtualHost>

<VirtualHost 74.53.106.146>
ServerAlias www.forums.residualvictory.com
ServerAlias forums.residualvictory.com
ServerAdmin webmaster@forums.residualvictory.com
DocumentRoot /home/residual/public_html/forums
BytesLog domlogs/forums.residualvictory.com-bytes_log
ServerName forums.residualvictory.com

User residual
Group residual
CustomLog /usr/local/apache/domlogs/forums.residualvictory.com combined
ScriptAlias /cgi-bin/ /home/residual/public_html/forums/cgi-bin/
</VirtualHost>

And the bind file for his domain

Quote:

; Modified by Web Host Manager
; Zone File for residualvictory.com
$TTL 14400
@ 86400 IN SOA ns1.lucidic.com. root.lucid.lucidic.com. (
2007050705
86400
7200
3600000
86400
)

residualvictory.com. 86400 IN NS ns1.lucidic.com.
residualvictory.com. 86400 IN NS ns2.lucidic.com.


residualvictory.com. 14400 IN A 74.53.106.146

localhost.residualvictory.com. 14400 IN A 127.0.0.1

residualvictory.com. 14400 IN MX 0 residualvictory.com.

mail 14400 IN CNAME residualvictory.com.
www 14400 IN CNAME residualvictory.com.
ftp 14400 IN A 74.53.106.146
forums 14400 IN A 74.53.106.146
www.forums 14400 IN A 74.53.106.146
* 14400 IN A 74.53.106.146

View 10 Replies View Related

Apache :: Will Editing HTAccess File In Cpanel Effect All Wordpress Domains And Subdomains

Mar 26, 2014

I added the following to my cpanel .htaccess file on my hosting account:

<FilesMatch ".pdf$">header set x-robots-tag: noindex
</FilesMatch>

This was to stop Google from crawling and indexing my PDFs, will this work accross all my addon domains and subdomains (which are wordpress) on my hosting account or do I need to take extra measure?

View 4 Replies View Related

Support Wildcard Subdomains?

Aug 25, 2008

"Do you support wild card sub-domains?"

a web host has sent me the following:

"Wild card sub-domains will not work with our standard shared hosting accounts. although the DNS configuration is available to have any sub domain not listed direct to an IP address the actually hosting account will not recognize a wild card DNS entry unless you have manually added the specific name of the sub domain."

The only part I understood was the first line. Maybe it is my lack of hosting related knowledge or maybe because English is not my native language, the second sentence is very confusing to me.

What is tech rep trying to say?

View 12 Replies View Related

Symlink With Wildcard Subdomains

Jun 28, 2007

I'm trying to create a symlink (ln -s) in SSH with the goal of having a php-file to be able to be reached from my wildcard subdomains "username.domain.com". The reason is because of XMLHttpRequest that resides in the php-file. When trying to access it from username.domain.com I only get an error, because of the cross-domain issue.

Anyway, I got the suggestion of creating a symlink on the file system, but I can't really get the symlink right... Where should I place it on the file system?

This is the path to the script;

Code:
/home/web2753/domains/domain.com/public_html/ajax/status.php
I tried creating the symlink in various places, like in the /domains/ directory;

Code:
ln -s /home/web2753/domains/domain.com/public_html/ajax/status.php
But I don't seem to get it right! If I have understood everything correctly, I'm supposed to create a symlink for status.php so the Subdomains can access it as if it was placed directly under the subdomains.

This is what my .JS file looks like (with the XMLhttprequest, this might not matter..?)

Code:
/home/web2753/domains/domain.com/public_html/javascript/edit.js

Code:
var cururl = 'htp domain com'; // this forum didn't like this url?

function createRequestObject() {
var req;

if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
} else if (window.ActiveXObject) {
req = new ActiveXObject("Microsoft.XMLHTTP");
} else {
alert('Problem creating the XMLHttpRequest object');
}

return req;
}

function handleDivTag(divtag) {
var divtag;
return divtag;
}

var http = createRequestObject();
var divhandler = new handleDivTag(null);

function sendRequest(ua_id,show,series) {
http.open('get', cururl+'ajax/status.php?ua_id='+ua_id+'&show='+show+'&series='+series+'&dummy=' + new Date().getTime());
http.onreadystatechange = handleResponseTwo;
divhandler.divtag = ua_id;
http.send(null);
}

function handleResponseTwo() {
if (http.readyState == 4 && http.status == 200) {
var response = http.responseText;
if (response) {
document.getElementById('editinfo'+divhandler.divtag).innerHTML = response;
}
}
}
Everything works except of the cross-domain issue which I'm trying to overcome by creating a symlink.

View 1 Replies View Related

WordPress MU Godaddy Shared Hosting Wildcard Subdomains

Jan 5, 2009

I have a site hosted at Godaddy.

My hosting account is shared delux.

I have recently added multi blogger Wordpress MU.

A single main blog is working fine but all other blogs are showing errors.

I have installed for subdomains.

View 1 Replies View Related

Plesk 12.x / Linux :: Wildcard Subdomains Of Alias Domains

Jan 3, 2015

System: Plesk Panel 12, updated on CentOS 6

Situation:
"Main-domain" domain with 2 "alias-domains" (301-forward). For "Main-domain" I created a wildcard subdomain. All works fine.

ToDo:
I want to create wildcard domains for both "alias-domains".

Problem:
It is not possible to create wildcard subdomains for both "alias-domains".

1. How to create wildcard-subdomains on "alias-domains"?
2. How do I disable Plesk to respond to every domain, which isnt covered by a wildcard?

View 6 Replies View Related

.htaccess Subdomains

Jul 13, 2008

to have abc.mydomain.com redirect to mydomain.com/abc

to do this, I have:

1) created a DNS record at my hosting company, *.mydomain.com and it works, any made-up subdomain correctly points to my server.

2) using Plesk, I created a DNS record, *.mydomain.com

3) in an .htaccess file, I put:

RewriteEngine On

RewriteCond %{HTTP_HOST} !^www.mydomain.com
RewriteCond %{HTTP_HOST} ([^.]+).mydomain.com [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/%1 [L,R]
... but the thing doesn't work, I keep getting the server's default page:

This is the Control Panel default page

If you see this page it means:

1) hosting for this domain is not configured

or

2) there's no such domain registered in Control Panel.

View 4 Replies View Related

Apache Wildcard DNS

May 18, 2007

one of my customers asked me if i can enable the WildCard DNS for him on Apache.
i just want to know is it any security issue with this if i enable it? can it be a security problem for my server if i enable it?

if not, how can i enable it?

View 4 Replies View Related

Apache Wildcard Docroots

Aug 24, 2007

Been searching google for a while and havn't stumbled upon anything useful.

I'm trying to have it so username.mydomain.com opens their directory inside /home/users/username

This is what I have but it doesn't seem to be working.

<VirtualHost *:80>
UseCanonicalName off
ServerAlias *.mydomain.com
ServerName *.mydomain.com
DocumentRoot /home/users/%1
</VirtualHost>

View 14 Replies View Related

Apache :: Every Path Is Forbidden After Enabling Wildcard Vhost

Aug 3, 2014

I've been developing websites using Apache on various Ubuntu laptops over the years. I just set up a new laptop with Apache and it worked fine. If I went to localhost in my browser then it showed the default page. So far, so good.

I then added a file to sites-available to add wildcard virtual hosts. This lets me use convenient urls while developing sites on my laptop. Once I enabled this site, every url that resolved to localhost became 403 Forbidden, including urls that should return 404. Here is an example entry from other_vhosts_access.log...

View 5 Replies View Related

Apache :: Unable To Set Subdomains In 2.4

Apr 22, 2013

trying to find a working solution for setting up a subdomain for my Apache server.

Here is my setting:

(1) I have two virtual hosts defined in httpd-vhosts.conf: domain1.com and domain2.com. Included NameVirtualHost *:80 both into httpd-vhosts.conf and httpd.conf.

(2) Settings in httpd-vhosts.conf:

Quote:

# domain1.com virtual host.
ServerAdmin info@domain1.com
DocumentRoot "d:/Websites/domain1_com/www"
ServerName domain1.com:80
ServerAlias *.domain1.com

[Code] ....

So far, everything works perfectly.

(3) Now, I added a virtual host for subdomain:

Quote:

# sub.domain2.com virtual host.
ServerAdmin info@sub.domain2.com
DocumentRoot "d:/Websites/sub_domain2_com/www"
ServerName sub.domain2.com:80

[Code] ...

4) Here the problem comes. When I enter sub.domain2.com into browser, it shows domain1.com content.

(5) Based on some suggestions, I removed asterisks from ServerAlias lines. This made the subdomain working, but messed up the other two servers, which became unavailable or broken down.

View 8 Replies View Related

Apache :: Subdomains Served By Themselves?

Oct 12, 2013

When I type mail.mydomain.com into any browser it resolves to the first virtual host that my apache has even though there aren't any document roots defined for mail.mydomain.com. Apache itself works fine, mail server itself works fine as well. I thought that since mail.mydomain.com has an A record but does not have any document roots specified for that Apache simply takes the first virtual host it has on its list and shows it up online as mail.my domain.com. Is that not right? Is there perhaps any misconfiguration somewhere?

I tried deleting virtual hosts one by one and this test simply confirmed that in order to "serve" mail.mydomain.com Apache takes the first virtual host it has on the list. Then I created a document root for mail.mydomain.com and now it shows some test content I specified but my issue / question remains.. Does it mean that I have to create document root stuff for every single A record I have? For example I have an A record for mail. mydomain. com which works as a mail server but for some reason it also resolves as a simple web page?

The problem in short is that when I type mail.mydomain.com into a browser it shows the content from subdomain.mydomain.com. The relation to mail is not webmail, it's just a regular standard mail server. The question / goal is to find out whether it is supposed to be like that? If it is then I will have to create some content to be shown when someone types mail.mydomain.com

View 14 Replies View Related

Apache :: How To Set Up Virtual Subdomains

Feb 10, 2014

I'm using the following vhost script: URL...This used to work on an older version of apache in Windows. Now I'm running Apache 2.4.6 on Ubuntu 12.04.

When I type in, for example, dhae.papertower.dev, it processes some scripts internally and moves me to www.dhae.papertower.dev.. and breaks. When I check my log, I find that it's trying to go to the /var/www/papertower/www directory.

I tried adding www.*.papertower.dev to the ServerAlias, but that didn't do it.

View 1 Replies View Related

Configuring Subdomains In Apache On A Localhost

Apr 27, 2006

I'm currently trying to configure apache 2 to handle subdomains. This is on a local machine (not tied to any domain names) and I'm only doing it to research how the final structure of a site 'could' be setup.

Basically I have a single install of Apache 2 running. The outcome eventually should be to have specific sub domains that all point to the same document root as the actual domain name. So eventually I will have:

http://www.mydomain.com
http://subdomain1.mydomain.com
http://subdomain2.mydomain.com

with both subdomains showing the content at mydomain.com (there is reasoning behind this but I'm not gonna go into that).

I have apache setup as follows:

NameVirtualHost *:80

<VirtualHost *:80>
ServerName daneastley
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"
</VirtualHost>


<VirtualHost *:80>
ServerName subdomain1.daneastley
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"
</VirtualHost>

<VirtualHost *:80>
ServerName subdomain2.daneastley
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"
</VirtualHost>

Now on my local machine, only the top one works - the subdomains dont. if I add the following into my hosts file in windows, they all work:
127.0.0.1 daneastley
127.0.0.1 subdomain1.daneastley
127.0.0.1 subdomain2.daneastley

the problem being, that I wish to test this enviroment on the local network. How would I go about having every computer being able to access this? I'm assuming it comes down to DNS stuff.

View 0 Replies View Related

Apache :: Internal URL Rewrite Across Subdomains

Jun 8, 2013

I want to rewrite across subdomains, e.g. requests for sub1.mydomain.com/foo.htm -> www.mydomain.com/foo.htm. I can do

this with something like:

Code:
RewriteCond %{HTTP_HOST} ^sub[0-9].
RewriteRule (.*) http://www.mydomain.com/$1 [R=303,L]

I want to make it an internal rewrite though, not an external redirect. If I remove the [R=303] I still end up with a redirect (a 302). I assume mod_rewrite is forcing an external redirect because it's to a different [sub]domain.

Is there any way I can overcome this and make the change internal?

View 2 Replies View Related

Apache :: Redirecting All Subdomains To HTTPS

Jan 21, 2015

Say I have two domains: example.com and example.net.

Upon a http request to example.com, I wish to redirect to https://example.com.

Upon either a http or https request to example.net, I wish to redirect to https://example.com.

Note that for both cases, subdomains should also be redirected, and the change should be considered permanent.

I've seem multiple ways to do so. What is the best way? How do I deal with subdomains when there is a new domain such as example.net to example.com?

I've taken a stab. How to fill in the gaps?

View 1 Replies View Related

Subdomains Half-way Created And Ignored By Apache

May 27, 2015

Since a week ago or so, in one of our Plesk 12.0.18 / Centos 6.6 servers, when we create subdomains the process seems to stop half-way without being finished.

To reproduce the error:

Select a subscription (e.g. example.com) and go to "Domains and subdomains"
Select "add new subdomain" and enter a value (e.g. new.example.com). The directory will live in parallel to httpdocs
Click Accept

Expected result:

The subdomain should be created: Filesystem diirectory with default contents, DNS entry, Apache VirtualHost, etc.

Actual result:

After several minutes Plesk responds with Internal Errror (in a red area in the panel).

Things done right:

The file space in parallels with httpdocs is created fine with the default site.
DNS entries are created under /var/named/chroot infrastructure.
The subdomain menu appears fine in the Plesk panel.

Things wrong/missing:

The filesystem directory is not mapped by Apache. Even after changing its contents the default server templeate appears in the browser, (all precautions taken, apache restart, browser in private session and different browsers).

Log info:

- /var/log/sw-cp-server/error_log says:
2015/05/27 18:17:45 [error] 28890#0: *1828 readv() failed (104: Connection reset by peer) while reading upstream, client: nnn.nnn.nnn.nnn, server: , request: "POST /smb/web/add-subdomain HTTP/1.1", upstream: "fastcgi://unix:/var/run/sw-engine.sock:", host: "<hostname>:8443", referrer: "https://<host>:8443/smb/web/add-subdomain"

- /var/log/httpd/access_log records the access with 200 OK codes although I don't find them in neither subscription logs under /var/www/vhost/system/*/logs/access_log
nnn.nnn.nnn.nnn - - [27/May/2015:18:38:35 +0200] "GET <deleted_content_in_the_subdomain_directory> HTTP/1.1" 200 14036 "http://<new_subdomain>" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:34.0) Gecko/20100101 Firefox/34.0

I don't find the Apache VirtualHost .conf files for subdomains, where can I look for them up...

View 4 Replies View Related

Apache :: VirtualHost - Configure Subdomains?

Jan 14, 2013

I have substituted the domain names and DocumentRoot folders for generic titles, so I will refer to those where applicable in the thread as well.

Here is my httpd-vhosts.conf:

<VirtualHost *:80>
DocumentRoot "C:WebServerwww"
</VirtualHost>
<VirtualHost *:80>

[Code] ....

View 1 Replies View Related

How Do I Rid Of The Generic Apache/cPanel Page When Subdomains Are Accessed

Aug 1, 2008

I just picked up a WiredTree VPS account, but have never really dabbled deep into server-related knowledge. I was wondering what one would do to rid of the "Great Success!

Apache is working on your cPanel® and WHM™ Server" pages when subdomains are accessed?

View 0 Replies View Related

MS Virtual PC - How To Access My Localhost (Apache) Subdomains On Guest OS?

Mar 23, 2007

I've just downloaded Microsoft Virtual PC and the Internet Explorer 6 Application Compatibility VPC Image containing an XP installation for testing sites with IE6 [url].

Everything works fine, I chose VPC Shared Networking (NAT) and I can access the internet from the VPC as well as my Apache development server which runs on the host OS (Win XP) by going to the host's IP address which is [url] in my case. And here I have 2 problems:

1. I want to access [url]on VPC just by typing [url]. I added the following line to the hosts file:

192.168.52.141 localhost

But this doesn't work. Interestingly, any name other than localhost works fine, for example:

192.168.52.141 localhost.localhost
or
192.168.52.141 local

This is not a major problem but I'd prefer localhost. Any ideas how to do that?

2. And the more important issue: on my host OS I have some development sites which I have set up to be accessed by subdomains, for example [url], in httpd.conf:

Code:
<VirtualHost 127.0.0.3>
ServerName perfekt.localhost
DocumentRoot C:wwwperfekt
DirectoryIndex index.php index.html
</VirtualHost>
and in hosts file:

Code:
127.0.0.3 perfekt perfekt.localhost
And now I want to access this site from my VPC too by using subdomains like this! How can I do that? The address 127.0.0.3 seems to be local to the OS and VPC can't see it. I have tried setting other IP addesses in httpd.conf but nothing outside the 127.x.x.x range works on either OS. I suppose I need to make each of my sites to be seen under a different IP from the outside network so that VPC (which is "outside" the host OS) can access them - then I just set up the appropriate subdomain names in VPC hosts file -

View 0 Replies View Related

Apache :: Setting Up Domains And Subdomains - Virtual Host

May 31, 2014

I am trying to set up domains and subdomains, on my webserver, however the domains are resolving, but when accessing a subdomain I get a 500 internal server error, permissions on files are the same on both domain and sub domain level.

My virtual host files looks like this for domains and for the subdomains, and I am using Apache 2.4.7, on an ubuntu 14.04 running on a rackspace cloud server.

Domains:

<virtualhost *:80>
ServerAdmin mail@mail.mail
ServerName domain.com
ServerAlias www.domain.com

[Code] ....

Why it works on domains, and not the subdomains?

View 1 Replies View Related

.htaccess Issue With Apache 1.3, But Works On Apache 2.2

Mar 22, 2008

I have the following Apache redirect code in .htaccess:

RewriteRule ^sap-latest-news/([0-9]*)/([A-Za-z0-9_-.]*).htm$ /domain.com/app/modules/content/latestNews.php?id=$1 [L]

This redirect works fine on Apache 2.2.8, but doesn't work on Apache 1.3.41

The following is the entry from error_log:
RewriteRule: cannot compile regular expression '^sap-latest-news/([0-9]*)/([A-Za-z0-9_-.]*).htm$'

A simple Rewrite is working fine in Apache 1.3, but the above regualar expression doesn't seem to be working on Apache 1.3. Does anyone know whether Apache 1.3 doesn't support it?

View 3 Replies View Related

Set Apache Handler Through .htaccess - Possible?

Jun 2, 2007

I am running into a bit of a problem. Previously, I can add an apache handler through cPanel easily... but now I moved to mediatemplate.net and that feature isn't available on their contol panel. Since they also run apache, I figured that I can set the apache handler manually through an .htaccess file - is that possible? If so, what is the syntax that will enable me to set .html files to be handled like .php files?

There is one setback to this process - this will be a manually inserted file for every directory that I want to do the above stated file handler. Is there an easier way to do this via SSH? I don't have root access, only normal user access.

View 3 Replies View Related

How Enable Htaccess On Apache?

Jun 2, 2009

Hi Htaccess not working in my server how Enable htaccess on Apache ?

View 14 Replies View Related

Htaccess Not Work On Apache

Nov 3, 2009

im installing APACHe on windows server 2003 but .htacess not work on apache

View 4 Replies View Related

Apache :: HTAccess - How To Do URL Rewrite

Oct 23, 2014

I have been trying to figure out how to do a url rewrite but no luck so far.

How can I have this [URL] ....

as the default [URL] ....

View 2 Replies View Related

Apache :: How To Use HTAccess And HTPasswd

Jan 26, 2014

I am have trouble using .htaccess and .htpasswd to password-protect a directory on my web server. How do I use .htaccess and .htpasswd to protect a directory?

View 3 Replies View Related

Apache :: Redirect URL Using HTAccess

Jul 17, 2013

I have a website. I would like to redirect all user/author url to one author/admin...e.g All aurthor links to redirect to one author link

author 1. mysite (dot) com/author/x
author 2. mysite (dot) com/author/y
author 3. mysite (dot) com/author/z
they are about 300

I would like all of them to redirect to author 2. mysite (dot) com/author/admin.

View 3 Replies View Related

Apache :: What Is HTAccess File

Jan 31, 2013

what is .htaccess file? use of this file?

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved