Apache :: Cross Domain / Setting Up HTAccess
Mar 30, 2014
I'm trying to set up a login script on twenty subdomains that will be checked on another subdomain. I've found this example for different domains and figure it should be simple enough to utilise but my ereg is crappy
<IfModule mod_headers.c>SetEnvIf Origin "http(s)?://(www.)?(domain1.com|domain2.com)$" AccessControlAllowOrigin=$0$1Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin</IfModule>
View 4 Replies
ADVERTISEMENT
Jan 1, 2007
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
That's the wordpress .htaccess
What makes me wonder is if we delete RewriteCond %{REQUEST_FILENAME} !-f, it won't work.
As if there is a recursion. However, there can't be a recursion given the [L] thing right?
View 0 Replies
View Related
Jul 1, 2015
I have maindomain.com addon-1.com addon-2.com addon-3.com
The addon domains are folders in main domain's root.
The problem is maindomain's htaccess is affecting the addon domains. I want the add on domains to have their own htaccess. The addon domains should not be influenced by main domain's htaccess
I did some research online and someone says this method works:
Code:
RewriteCond %{HTTP_HOST} ^(www.)?addon_domain.com
RewriteRule .* - [L]
But the above assumes you only have one addon domain. I have multiple.
Which code is correct? This
Code:
RewriteCond %{HTTP_HOST} ^(www.)?addon-1.com
RewriteRule .* - [L]
RewriteCond %{HTTP_HOST} ^(www.)?addon-2.com
RewriteRule .* - [L]
RewriteCond %{HTTP_HOST} ^(www.)?addon-3.com
RewriteRule .* - [L]
Or this
Code:
RewriteCond %{HTTP_HOST} ^(www.)?addon-1.com
RewriteCond %{HTTP_HOST} ^(www.)?addon-2.com
RewriteCond %{HTTP_HOST} ^(www.)?addon-3.com
RewriteRule .* - [L]
do I put the code at the beginning of main domain's htaccess?
View 3 Replies
View Related
Feb 25, 2014
I'm trying to accomplish two goals: First, get "Pretty Links" to work on my local Wordpress instance; second, to set up a local domain for the site.I have a fresh install of Apache 2.4.6 running, and I'll I've done is enable the rewrite and vhost_alias mods. Nevertheless, here's my apache2.conf: URL....
I need to have AllowOverride set to All. This, I gather, allows .htaccess files within the subsequent directories to alter the apache config. To try one thing at a time, I'm accessing the site from localhost/var/www/dhae/Wordpress (foregoing the domain). I tried altering the 000-default.conf to oblige this: [URL] .... -- all I added was the <Directory> section. This didn't work, and neither did changing the AllowOverride to All in the apache2.conf.
I wondered if perhaps I needed something more specific to the directory, so I tried using my second goal to accomplish this. I wrote the dhae.conf: URL....
I've also added the following line to my HOSTS file:127.0.0.1 dhae.dev
This hasn't worked either. I've tried virtual host config stuff as much as I could find, and I'm just not having any luck. What I have even came from this site (URL....).
View 7 Replies
View Related
Aug 23, 2014
I would like to make a cgi cross platforms. Some servers are running Ubuntu server, 32 bit others are running Centos 64 bit and so one. How do i make a cgi script that run well at least for Linux based operating systems such as Debian, Ubuntu, RedHat and so one ?
View 1 Replies
View Related
Nov 26, 2014
We have following rule in httpd-vhosts.conf and it was working all ok.
All of sudden we have found on one day that it stopped working and we did some configuration tweak with this rule but none of them worked.
During troubleshooting, last change was disabling mod_security and after that it started working again. However, next day we had again enabled mod_security to get issue replicated but found it working all ok.
Any clue for such behaviour of Apache ? Why all of sudden following working rule may get stopped working and then starts working again ?
<IfModule mod_headers.c>
SetEnvIf Origin "https://(www.)?(v1.abc.com|v1ak.abc.com|v2.asite.com)$" AccessControlAllowOrigin=$0$1
Header Set Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
Header Set Access-Control-Allow-Credentials "true"
Header Set Access-Control-Allow-Methods "GET, POST, OPTIONS"
Header Set Access-Control-Allow-Headers "origin, content-type, accept, X-Requested-With"
Header always unset Expires
</IfModule>
OS and Apache Version details are below:
Apache Version :2.2.27(win32), OS: Windows 2008 R2, ModSecurity Rule Set ver.1.5
View 1 Replies
View Related
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
Oct 21, 2007
I have what I think is kind of a unique situation with a site move and Google is not turning up an answer that seems to work.
My site is currently in this format:
www.mydomain.com/site/file.html
And I am "moving" it but also switching from html to php, so the same file would be found at:
site.mydomain.com/file.php
I want to redirect users going to the old pages to their equivalent on the new site, however this is a little bit of a problem because this is a normal subdomain - it is the same directory as before but now there are php versions of the html files.
Right now I have all of the http files redirecting to their php equivilents, but I don't believe this is a desirable solution. Also it creates a problem when people go to www.mydomain.com/site (not indicating a specific file; just the subdir root) because I have www.mydomain.com/site/index.html redirecting to www.mydomain.com/site/index.php.
Quite a mess.
My first option is to put the redirects in the htaccess file on the "old" site. But is this a problem because there are over 500 pages on the site? Does it create a heavy server load because any requests force the server to serve a huge htaccess file?
The next alternative seems the most preferable although I'm not sure how to do it. It seems it could use wildcards so that anyone going to *.html gets directed to *.php or something like that. The only problem is that there are a small number of files that were removed completely and do not have php equivilants (about 5 or 6) and would need to redirect to the index.php in the root
View 14 Replies
View Related
Jun 14, 2014
I have re-built a website on a new domain. Now I want to redirect http://www.olddomain.com/anything or http://olddomain.anything to www.newdomain. Because the file structure is totally different, I want all redirections to go to the Home Page of newdomain.
Initially, I used Standard forwarding in the Plesk CP but that attempts to keep the filename the same. So www.olddomain.com/wibble tries to go to www.newdomain.com/wibble. But wibble dies not exist on the new domain.
Should I use htaccess with physical hosting instead on olddomain.com? Is the following correct?:
Code:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^olddomain.com [NC]
RewriteRule ^(.*)$ http://www.newdomain.com [R=301,L]
Will that basically cover any request? Anything that people have saved or which appears in Google searches, no matter whether http:// or http://www.
And for neatness on the new domain, I would like to add www to any request like http://newdomain.com/whatever to go to http://www.newdomain.com/whatever which I think means that Google analytics will report more accurately.
So would my htaccess file on newdomain.com be like this?:
Code:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^newdomain.com [NC]
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L]
View 3 Replies
View Related
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
Jun 2, 2009
Hi Htaccess not working in my server how Enable htaccess on Apache ?
View 14 Replies
View Related
Nov 3, 2009
im installing APACHe on windows server 2003 but .htacess not work on apache
View 4 Replies
View Related
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
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
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
Jan 31, 2013
what is .htaccess file? use of this file?
View 6 Replies
View Related
Jan 25, 2013
I have a directory of /flash/1.swf all the way to /flash/4000.swf on my hosting.I am trying with terrible luck to load the flash movies into the container on zomgflash dot com(avoiding possible spam) -- its all setup...it should be loading the movies...I think it's a mod_rewrite problem but I could be wrong...it's basically a clone of iwantmoar dot com(avoiding spam again) -- you'll notice when you type a number after the domain like /238 or /2898 that it loads up /flash/238.swf or /flash/2898.swf into the flash container on the iwantmoar website. That's what I'm trying to get my website to do.
I need them shown like [URL] .... in the address bar... and that would have index.php load up 1.swf in the container if that makes more sense.This is the contents of my .htaccess from my relentless googling:
<IfModule mod_rewrite.c>
Rewrite-engine on
RewriteRule ^([0-9]+)$ /index.php [PT]
</IfModule>
ErrorDocument 404 /index.php
View 1 Replies
View Related
Dec 26, 2005
I've taken a reseller account from ResellerZOOM which came with WHM/cPanel. I've my own private nameservers(meaning I got my own IP). I've a domain that I want to be forwarded to my wordpress.com blog, just like domain registrars offer domain forwarding but the registrar I registered my domain with doesn't give domain forwarding. so I was thinking that maybe I can point the domain to my nameservers & then have it forwarded to my wordpress.com blog. The thing is that I haven't used WHM before & I don't know how to do it, create some DNS zone maybe!!
The only way I know is to create an account for that domain, allot it some diskspace & then redirect via .htaccess file, which would be overkill IMHO. I know it can be done without creating an account, some other way.
View 3 Replies
View Related
Jun 9, 2009
its been long time since I have set one and its been really bugging with the feather theme interface, which I haven't used before
now, here is the pt.
I have 3 ips , I want the main ip to be unique
i.e assuming .2, .3 and .4 are the the ips we have ben provided with, where .2 is the main ip of the server (lxadmin)
now, in the dns template, I have 6 options where ip has to be assigned, as -
base, cp, mail, ns, ns1, ns2
I have set the base,cp, mail, ips to .3
I don't have a clue on what to set for the ns, ns1, ns2
I want .3 to be shown as the pinged ip when site is pinged.
We have set .3 and .4 as the nameserver ips in the registrar, so do I need to provide .3 as the ns1 ip and .4 as the ns2 ips or both the ips have to be .3
and what should be the ns ip?
View 1 Replies
View Related
Jul 23, 2009
I've got DirectAdmin installed, and my domain name (misacampo.org) hosted with XeoDomains.com.
I'm wondering how I set up my DNS so that whenever I point more domains to my VPS their DNS will be set to ns1.misacampo.com and ns2.misacampo.com.
Would it be as simple as pointing my domain to my VPS IP, then setting up this in DirectAdmin?:
Add Zone
Domain Name:
IP Address:
Name Server 1:
Name Server 2:
Would I enter:
Add Zone
Domain Name: misacampo.org
IP Address: xxx.xxx.xxx.xxx
Name Server 1: ns1.misacampo.org
Name Server 2: ns1.misacampo.org
Then point my domain to xxx.xxx.xxx.xxx, and set it up my domain at XeoDomains.com like so:
Add New Child Name Server
Host Name: ns1.misacampo.org
Ip Address: xxx.xxx.xxx.xxx
and
Add New Child Name Server
Host Name: ns2..misacampo.org
Ip Address: xxx.xxx.xxx.xxx
Would this work? I'm looking to do a quick shift from my old CPS (LXAdmin) to my new VPS (DirectAdmin) with at little downtime as possible. Do I need to set up any other records for the domain for my email accounts to work, or would DirectAdmin take care of all this?
View 1 Replies
View Related
Jul 31, 2007
I've registered a domain about an hour ago called animeclassicreviews.com
Nothing comes up, all i get is 'under construction' or i get a 404 error if i remove the www, i tried to forward url to my blogspot account but nothings happening.
View 9 Replies
View Related
Jun 13, 2007
Does anybody know any solution to prevent this?
Basically every customer can bring server down with malformed htaccess.
Is there any solution to prevent this?
This doesn't help:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteOptions MaxRedirects=5
</IfModule>
this htaccess causes problems:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
View 6 Replies
View Related
May 11, 2013
I've not seen an answer for this mass 301 redirect issue specifically.. How to do this...
category/brand URLs:
redirect: /ID-some-brand (e.g. /43-religion-clothing or /26-ichiban) to: /some-brand (e.g. /religion-clothing or /ichiban)
Product URLs:
redirect: /some-category/ID-some-product-name.html (e.g. /mens-sweat-shirts/1543-ichiban-fairly-offensive-sweat-in-grey.html)
to: /some-product-name (e.g. /ichiban-fairly-offensive-sweat-in-grey)
We have 1,090 products and 60+ categories so some form of .htaccess trick would be amazing to know. What I could put in the .htaccess to accomplish this.
View 1 Replies
View Related
Jan 25, 2014
Well, I was trying to use the following in htaccess, but I get the message of redirect loop.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?page=$1 [L,QSA]
What I want to do is this: The URL is like somedomain.sub.com/somepage/s1/s2The index.php is accessible from somedomain.sub.com/somepage/I want to send s1/s2 as $_GET['page']
Also, I don't want the URL in the address bar to change, only the url sent to the server should change. This worked well in my localhost, but on webserver (0fees.net), it doesn't work ...
View 1 Replies
View Related
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
View Related
Feb 21, 2013
I have page like that : [URL] ....
I want to permanent redirect it to : [URL] ....
Also needs to redirect all another page have words ( rates ) to index.
View 9 Replies
View Related
Jun 11, 2014
I'd like to change /comp.php to /comp but I have only found articles on how to remove .php completely and I don't want to do that, only want to do it for this one file.
View 5 Replies
View Related
Sep 18, 2014
One site just linked to my website with incorrect URL as URL.. want to correct this by redirecting the URL to URL.... Therefore, I add the following line in my .htaccess, as follows: Redirect 301 /aor/%e2%80%9d URL...
However, this does not work. When I input URL... in Firefox or IE, the browser still said the page not found(404) error.
View 1 Replies
View Related
Jan 27, 2013
So, I would like my htaccess file to check if a file exists and if it doesn't then redirect to another file. How would I go about doing this?
View 5 Replies
View Related
Feb 20, 2013
Apache httpd Users mailing list, but nobody there has responded in several days. I'm using mod_alias to map URLs to directories that are outside of Apache's DocumentRoot. However, it seems that .htaccess files are being ignored in these directories.
View 6 Replies
View Related
Mar 18, 2013
I've modified my old website, and now need to remove the phrase "cheap-products"
Some example url's
randomdomain.com/product-1000-cheap-products/
randomdomain.com/product-1001-cheap-products/
randomdomain.com/product-1002-cheap-products/
How do I make it so it will forward (seo wise) to the following
randomdomain.com/product-1000/
randomdomain.com/product-1001/
randomdomain.com/product-1002/
View 4 Replies
View Related