Task:
We have a several DNS aliases (ex. project1.domain.com, project2.domain.com)
DNS aliases connected to JIRA Server by IP
Need link, ex. from project1.domain.com to jira.domain.com/project/TEST1
Need link, ex, from project2.domain.com to jira.domain.com/project/TEST2
How next? any ideas?
Thank you for the Help!
On your webserver, you need as many Virtual Hosts as domains you have declared, and each Virtual Host will have one HTTP redirection.
For example :
VirtualHost project1.domain.com
RewriteEngine on
RewriteRule ^/+(.*)$ http://jira.domain.com/project/TEST1 [R]
Related
I have a domainname, www.X.com that redirects (using some magic from the webhosting-company from which I bought www.X.com) any user that visits www.X.com to www.Y.com/test.
This works fine, but what I would like to happen is for the URL to remain www.X.com after the redirect. Right now, after the redirect the users URL changes to www.Y.com/test.
I'm not sure if htaccess rewriting at www.Y.com can fix this issue, so I would like to know wether this is possible and if so, how do I implement it in my .htacces file?
Regards and thanks in advance,
Robert
Instead of using the redirect tool of your hosting provider. You have to configure your domain to point to your server with a DNS A record:
Domain Type target server
www.X.com. A x.x.x.x
www.Y.com. A x.x.x.x
In your server virtualhost or via your hosting provider you need to configure both domains to point to your website.
In your .htaccess file you need ton configure domain www.X.com to point to the test directory:
RewriteCond %{HTTP_HOST} ^www.X.com$
RewriteRule ^(.*)$ /test/$1
Problem was solved by clearing out my Chrome cache; The webhost-magic HAD done the trick. Thanks mr Rockett and mr Lemaitre for your time!
I'm working on an old website and I've just found something strange. Www.mysite.com redirects to www.test.com, while mysite.com (non-www) redirects to www.other-site.com.
I've checked the htacces, and it only contains rules to redirect traffic to test.com. www.other-site.com is not present in the file. So how is it possible? Where should I check if there's a rule for this redirect?
Environment:
Centos server /
Apache /
Three sites are on different servers
This could be a DNS issue. If both www.test.com and test.com point to the same server then it is all server side. Virtual hosts can sometimes be the problem if you have Apache set that way then you will need a Virtual host for both www.test.com and test.com. I would say start with the DNS, then the apache config, then the site folder.
Hope that helps.
I have hosted my website using WHM and Cpanel,
and added following lines to .htaccess file
RewriteCond %{HTTP_HOST} ^103\.241\.144\.130
RewriteRule (.*) http://www.rockinexams.com/$1 [R=301,L]
now, this:
http://103.241.144.130/~rockinex/
redirects to www.rockinexams.com but 103.241.144.130 does not.
I heard that this does not work due to something related to cpanel architecture.
Is there any way I can achieve it?
If that IP is a shared IP, your rule will not work. For this rule work, you need a Dedicated IP to access just http:YOUR-IP. You even can try to put the ~rockinex on rule, but I don't think it will work.
I have my .htaccess setup as
order deny, allow
deny from all
allow from 123.my.ip
my IP is what ipchicken is giving me yet I am getting internal server error from any address. I have also tried multiple IP locations.
Following Apache copied from there site with this format just gives me forbidden even from my address...
Order Deny,Allow
Deny from all
Allow from my.ip.address
I have followed this question with no success...
.htaccess block all but my ip
I have also tried below from the following link with the same results...
http://kb.siteground.com/how_to_redirect_all_visitors_except_your_ip_to_another_site/
RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_HOST} !^1.2.3.4
RewriteRule .* http://www.anothersite.com [R=302,L]
Just in case its relevant, i'm running magento on a AWS server. Running out of ideas to try...
If you tried:
order deny,allow
deny from all
allow from {111.111.111.111} <-- example ip
its very straight forward that it should be working
what you need to do is enable rewrite.log in your apaches virtualhost config
to determine whats going on in there with mod rewrites/
make sure that you have given your apache virtuahost auth to read from .htaacess file
** Override to All
you shouldn't use mod_rewrite rules to disallow any ip but your, keep that for specific page rewriting, the above code should be fine.
Make sure! that you're IP address is your Internet ip address and not an internal ip address. Go on google and type in "what is my ip" it should give you the correct one
if none works, there's definitely something funky going on with your .htaccess file. Try to paste your entire .htaccess file to somewhere where we can all view it. There may be errors on your .htaccess file. Make sure magentos admin isn't over-writing your .htaccess file.
with .htaccess its a big factor where you place the rules. sometimes having too many things on there can confuse the web server if its not in order.
I have two internet addressess, say one.com and two.com
The content of my webpage is all under the domain one.com. If I hit address two.com I want it to redirect to one.com but still with address two.com. For example if I type in address bar two.com/article. I want to still show this same address but the content displayed would be as from address one.com/article
I tried to use htaccess file, but still no luck.
Any advice would be appreciated.
You can't achieve that while performing an external redirect.
If both domains are hosted on the same server, then you can perform an internal redirect (e.g. using Apache's Alias, AliasMatch or mod_rewrite).
If the domains are hosted on different servers, then you would have to proxy one of them. You could do this with ProxyPass from Apache's mod_proxy.
Go to your domain name provider and create an alias (CNAME record) for the address.
You will need to enable mod_proxy in your Apache config for that. Once mod_proxy is enabled, enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory on domain2.com host:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.domain2\.com$ [NC]
RewriteRule ^ http://www.domain1.com%{REQUEST_URI} [L,P,NC]