Apache :: Redirect Any Specific Page Of Site To Homepage
Feb 19, 2015How do i redirect URL: example.com/page1 to example.com..i want to redirect any specific page of my site to homepage.
View 3 RepliesHow do i redirect URL: example.com/page1 to example.com..i want to redirect any specific page of my site to homepage.
View 3 RepliesI'm trying to get code to go in a .htaccess file that when a specific IP tries to get a specific page, he/she is redirected to another page.
I have tried many variants of this code below ...
Code:
RewriteEngine On
RewriteCond %{REMOTE_ADDR} ^12.345.678.90$
RewriteCond %{REQUEST_URI} /requested-page.html$
RewriteRule .* /redirect-to-this-page.html [R=301,L]
... and nothing works. My webserver gets hosed, and my otherwise working system gives me an error when I try to get a page from it. I am, by the way, using Mac 10.6.8, with Apache 2.2 on both server and client.
What will work??
I have question: How to redirect specific useragent on specific URLs to specific URLs in .htaccess [Question]
E.g.:
I want to redirect 301 with conditional:
Code:
useragent: Firefox
from my url1: domain[dot]com/old-url1/
from my url2: domain[dot]com/old-url2/
to
Code:
to new url1: in my url1: domain[dot]com/new-url1/
to new url2: in my url1: domain[dot]com/new-url2/
I create this in my .htaccess but not work
Code:
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} googlebot [NC]
RewriteRule ^/?this-is-url/?$ domain[dot]com [L,R,NC]
I want to permanent redirect some .html page from subdomain to main domain WordPress page,Redirect permanent /cat/FSBO76.URL....
View 1 Replies View RelatedThis is the mod_rewrite rule I'm trying to create. I am very new to Apache admin. Here's the issue:
I have 3 vhosts running on my HTTPD Apache 2.2.24 server: Server1, Server2, Server3. Each vhost is connected to a Weblogic application server. We are trying to prevent access to the Example.portal page on each application server.
So the URLs I'm trying to rewrite are:
- Server1.domain.com/PortalWeb/Example.portal
- Server2.domain.com/PortalWeb/Example.portal
- Server3.domain.com/PortalWeb/Example.portal
So, I would like to redirect the above URLs back to the 'root' of the website. ie: server1.domain.com. Here is my rewrite rule:
RewriteRule ^(.*)/Example.portal$ http://$1 [NC]
So, the rule is matching correctly to URLs that contain Example.portal, however the back reference from (.*) does not seem to map to $1.
when i create an account, i see cpanel page on the homepage.
I checked httpd.conf and saw these <VirtualHost 72.233.37.131>
ServerAlias www.xxxxxx.org
When i change this line as 10.0.0.131 the page opening okey.
when i change main share virtual host ip to 10.0.0.131 in WHM, next creating
account dns ips added 10.0.0.131 so the site no shown
How can we solve this problem ?
my dedicated in private rack and using cisco firewall
I am trying to setup a subdomain and/or virtual host to redirect to a specific port and path. I have setup my server with DDYNS through my domain name registar. Through the ddyns client I have set it to assign a subdomain of "outside.name.com" so that my server will have a easy name to get to instead of a dynamic ip address.
I have also setup on my registrars host records another subdomain of "inside.name.com" with a static IP address for internet network accessing to my server.My problem is that I have a service/program on my server that I need access to both internally and externally and this service can only be access through a port of 32400 and HTTP address of /web. (e.g. outside.name.com:32400/web or inside.name.com:32400/web)...
Is there a way that I can create a VirtualHost or Subdomain of "service.*.name.com" that redirects them to ":32400/web" of the hostname they're on? (e.g. service.outside.name.com automatically forwards or proxies--to keep it pretty--to service.outside.name.com:32400/web)
I'm hoping to redirect visits to any page in an old directory to the index page of a new directory.
In other words, redirect:
[URL] ....
[URL] ....
Is this possible? If so, how could I do it?
In my .htaccess I currently have:
Code :
RedirectPermanent /facts/ http://www.domain.com/newfacts/
but this only redirects the index page.
Wordpress installation (WPML with 3rd level domain es. site. com, fr. site. com).I need to redirect page from old subdomain to a new subdomain
Example:
esp.site.com/oldpage -> es.site.com/newpage (different subdomain)
esp.site.com/oldpage1 -> es.site.com/newpage
esp.site.com/oldpage2 -> es.site.com/newpage
Source site is very chaotic (static pages + wp pages) and there are no clear rule for redirection (no regex ).So I need to redirect every single page but syntax:
Redirect 301 esp.site.com/oldpage http:// es.site.com/newpage doesn't work!I think "esp.site.com" in source page is not acceptable syntax..which is the correct syntax ? Can I manage all from one .htaccess file in main root (www) or should I create "esp" directory (and point old subdomain to it - one for every language) and put .htaccess in every directory with redirection ?
I need to create a redirect to a non existing page.
Here is my code and the site is on shared hosting
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^index2.php#!(.*)$ /index2.php/$1 [R=301,L]
</IfModule>
This would be [URL] ....
I would like to redirect Every request with "#!string" to new url (same page) - [URL] ....
I know that the code above needs
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
to be added but it doesnt even makes the redirect to 404. The url doesn't change.
When I restart my server all my domains opens at apache test page. Suspending and reactivating any domain fixes all domains.
View 4 Replies View RelatedI've got a VPS with XenSmart, and I'm running CentOS. Recently, I have been needing to redirect my users to 'www.', since if they don't put the 'www.' in front of the domain the vB forum doesn't run properly. Though, to do this, I edited the .htaccess file and was using the 'mod_rewrite' command, but this requires Apache.
So, on my VPS I've installed Apache, and set LXAdmin to use 'httpd' instead of 'lighttpd', though now my web pages wont show up and all I've got is the default Apache web page:
[url]
How am I able to use Apache (HTTPD) and have it load my current forum? My current forums hosted in:
/home/admin/public_html/vb
I have setup Nginx to serve static pages. I cache some pages and therefor they are static and should be served by Nginx. Now, how can i check if a specific page actual was served by Nginx and not Apache?
View 1 Replies View RelatedHow come when my reseller suspends an account, the suspended page just redirects to his homepage? Does something need configuring..?
View 3 Replies View RelatedI'm running into this issue over and over again. It seems like it goes like this...
Someone searches for one of my clients domains (all on one server) in google. When they click on the link in google, they get the google alert that it's an attack site (and in fact when you look at the address line you see that it's being redirected to an IP address). This only happens once, and when you click on the site again it works fine.
The IP address, or at least one, is 91.205.233.31
I found an article about dns cache poisoning, but that seems to be on the end user side of things, and as this is happening across a lot of different users, my instincts say it's something to do with my host.[url]
There is a security flaw in the Page 302 redirect. Basically, a Page 302 redirect is a temporary redirect used to inform search engine spiders of the new temporary location of a web page. Using this redirect, a malicious user or competitor can get your site off the SERPS.
View 1 Replies View RelatedI have came across site in my statistics that apperantly runs with about 99% of my content flash files. He put adsense all around them, too - sneaky.
I know it is possible to disable hotlinking from other sites using htaccess, but is it possible to disable hotlinking for ONE site? I need to block .swf that come from example.com domain.
Every domain that I have added just goes to the default Plesk landing page. I have:
* Added them as new subscriptions
* Added domains to a current subscription
* Verified that the index.html file is deleted
* Verified that vhosts is pointing to proper directory
* Confirmed that sites work when clicking 'preview'
If it matters, this is an Ubuntu install.
I have decided to move [url]photo to [url]
What should I do, so that a visitor who comes to
[url]
will be automatically transferred to [url]
I want it to be all inclusing, so if someone comes to [url]
he/she will be routed to [url]
I have root access to my server. I need the most efficient way, if there is a choice between some.
Ii need to redirect domain.com/register.html , domain.com/search.php and login.html to domain.com/index.php
Do anyone know how to do this with .htaccess?
Is there a way that I could redirect total urls? By that I mean when someone goes to www.domain.com/whatever/file.php?id=345 they get redirected to www.anotherdomain.com/whatever/file.php?id=345
Im running apache 1.3
About the 28th September the host that I was with decided to move servers and did not inform me of this. They tried moving my site and after 18 hours of being offline decided not move my site. It came back offline, only the main page displayed but nothing else works, if you click on anything it goes to 404 page error. Only problem is, the page is displaying data up to 23rd September.
I have a blog and a forum connected and both seem to have lost all the data from the 23rd to 28th September. I have since moved host since the previous host not only did not inform me that they were moving, they didnt even bother taking a backup. I have been with my new host for over a week now so the propogation is definitely complete. Now the problem is whenever I open my blog, it keeps pointing to 23rd September (I have added a lot of posts since then). If I refresh the page, then it will show the latest posts. This is not a problem with the forum though, it works fine.
When I add a new site via New Account in WHM and once the domain resolves, the cPanel 'Great Success' page shows. I have verified the site is resolving properly.
This is a brand new installation and the only changes I have made is I updated apache via WHM.
I have built a database driven site with PHP & MySQL. Pages download quicker on some connections than other (obviously), however this is not due to connection speed. The web host server seems to respond very slowly to my boss's network (which is on a proxy server). Could it be that this problem is related to the web host? i.e. could it be that the web host is unequipped to deal quickly with this type of network?
On my home connection (2Mbps), pages often download instantly, however occaisionally I have to wait 10-20 seconds to receive the page from the host.
Finally, could you recommend an excellent web host to use with our site? My boss wants to offer a professional service where server response is quick. We are based in the UK.
I have Apache 2.2 installed on my Unix Server and have a couple of Application servers running each of them having similar Document Root.
For example, The URLS will look like below
https://my-test1.com/demo/index.html
https://my-prod1.com/demo/index.html
https://my-qa1.com/demo/index.html
The directory folder looks like
/myapp/my-test1/demo/index.html
/myapp/my-prod1/demo/index.html
/myapp/my-qa1/demo/index.html
I would like to restrict access to the above prod1 URL for a specific set of IP's. How can I achieve this.
I have the following RewriteRule directive in my htaccess file on my localhost:-
Code:
RewriteRule ^([a-z-]+)/?$ test.aspx/app.nav/params.class.com${meta:$1}/whatever${meta:$1}
The rewrite rule works perfectly, since the revised URL is still preserved when after it is executed; I presume this is since my old URL is relative, and it's performing an internal rewrite.
However, when I make my old URL absolute (adding an external address to it), whenever I execute my new URL, I'm redirected to the external sites URL (which includes the same URL parameters as my internal 'test.aspx' page), like below:-
Code:
RewriteRule ^([a-z-]+)/?$ http://www.example.com/test.aspx/app.nav/params.class.com${meta:$1}/whatever${meta:$1}
Purely for demo purposes, upon execution, I'd like my new URL to be preserved in the address bar whilst, I'm redirected to the external site.
Is this possible to do - something like forcing the behaviour of an internal rewrite?
EDIT: I've done some investigating and people with similar problems have suggested using the Passthrough handler - although I'm slightly unclear as to what this does exactly, I gave it a go (adding '[PT]') at the end of RewriteRule, but unfortunately this didn't make any difference.
Is mod_proxy a possible solution?
I upgraded from 10.4.4 to 11.0.9 and saw no errors in the process, everything was fine. However when I checked the sites after, all of them (including sub-domains) were showing the default domain page. All the files are still there no problem, and as a test I deleted a subdomain a recreated it and it worked fine.
I have a feeling it's something to do with IP addresses (I currently have two set up - most sites use one and about only 5 use the other) as going to the subscription and changing the IP address over to the other one then back to the original seems to make the site show up for most sites. I can't do this on all sites though - any commands to reconfigure everything and get it all back in to place?
I disabled a site, and instead of getting the default placeholder when visiting the domain, I get another web site that I host.
[URL]