Replicating Internal Redirect Behaviour For Redirecting To External Site In Htaccess
May 19, 2009
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?
View 1 Replies
ADVERTISEMENT
Apr 25, 2009
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?
View 3 Replies
View Related
Oct 7, 2014
I have a -I think- common issue, one external server available from internet and an internal server for local only.
I want that to ask for [URL] ....
I can get the content of an internal server. For this I tried this at httpd.conf:
Redirect /site http://in.ter.nal.ip/site
but browser changes to internal IP and obviously I can't reach it.
So, I need that when external server detects that I want to see internal server content, it ask to internal and external itself answers.
View 2 Replies
View Related
Apr 26, 2009
I'm trying to redirect all people who go to [url]to [url]
I've got this but it doesn't do anything: (and I did verify that the .htaccess works, as
I added garbage text and tested and got an error).
Code:
Options +Indexes
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.mydomain.com/directory/$ [NC]
RewriteRule ^(.*)$ [url]
View 8 Replies
View Related
Apr 6, 2008
I have been trying for more than an hour to figure that out , but nothing....
I want to perform 2 types of redirects on my webpage/forum
I want all non-www to move to www.mysite.com/forums
and I also want the www.mysite.com to redirect to the /forums one...
All of those with WWW
I can make each work alone, but not these 2 together....
View 7 Replies
View Related
Mar 18, 2014
I'm trying to redirect some threads in vbulletin from full version to archive version, I just have some problems and I have not been able to resolve it.
I have the [URL] ...
and I want redirect to: [URL] ....
I have:
Options + FollowSymLinksRewriteEngine onRewriteRule ^showthread.php?([0-9]+)$ archive/index.php/t-$1 [R = 301, L]
View 1 Replies
View Related
Jun 27, 2009
We currently have two dedicated servers connected to each other with a crossover cable, and each one also has its own external connection. One is running Server 2k3, one is running CentOS with cPanel. What we want to do is configure the so they can run backups to each other through the crossover cable, saving our bandwidth
On the windows machine we have configured it with a static IP of 192.168.0.1 and subnet of 255.255.255.0. This works fine and the machine is running well, on the cPanel machine, when configuring eth1, like so:
HWADDR=**:**:**:**:**:**
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
NETMASK=255.255.255.0
IPADDR=192.168.0.2
USERCTL=no
the windows and cpanel machines can talk to each other fine through the crossover cable (pinging 192.168.0.1 + 2) but then the cPanel machine becomes unaccessable externally, i.e. ping requests time out and no websites on it can be hosted untill eth1 is disabled and the server rebooted.
View 7 Replies
View Related
Oct 27, 2009
app and content are separate physical machines
I want [url]to be processed by app directly, which it's doing now
I want [url]or [url]to display content from content, either directly or through a hidden/stealth redirect.
How can this be accomplished? How else can I have one URL serve from two different servers other than using subdomains?
View 1 Replies
View Related
Oct 30, 2008
Is there any way to redirect a subdomain on a machine A to point to an IP adress on a second machine B.
View 11 Replies
View Related
Nov 30, 2007
am protecting my entire site with .htaccess/.htpsswd
i get promoted to enter username and address
ok that's fine
however after that the page doesn't load and instead i get:
++++++++++++++++++++++++++++++++++++++++++++++++++
500 Internal Error
The requested page produced an internal error. If you are the webmaster of this website please check: That script has been uploaded as ASCII (if CGI/Perl)
If the file and folder permissions are correct, e.g. 755
Your .htaccess file (if any).
Servage.net Clustered Webhosting running enhanced Apache Webserver why is that guys??
++++++++++++++++++++++++++++++++++++++++++++++++++
View 5 Replies
View Related
Oct 23, 2008
We're on Apache and when I insert a handful of 301 redirect statements, the 500 internal server error comes up.
Example:
Redirect 301 /products/tech.html /products/technology.html
It doesn't matter if I used the absolute URL or not for the new destination.
View 8 Replies
View Related
Jun 6, 2009
Apache redirect. I would like to point all the old site URLs to my site homepage e.g.
[url]should point to [url]
or better,
[url]should point to [url]
tell me the redirect code i need to add to my .htaccess file to make this work?
View 3 Replies
View Related
Apr 28, 2008
I know how to do a redirect to a new URL using a .htaccess file if I am pointing to a different server, however both domain.com and domain.com.cn are pointing to the same server, I just am wondering what I would add into my .htaccess file to get it to redirect from domain.com.cn to domain.com?
View 4 Replies
View Related
Feb 27, 2007
I am trying to redirect from:
[url]
over too:
[url]
Now the software i'm using on the /forums/ is different, so i need ALL inbound links to any area of phpBB2 to redirect to /forums/ and be stripped of the "index.php=topic111.22."
All the redirects I have tried seem to leave the rest of the URL on then give a page not found.
View 3 Replies
View Related
Jul 12, 2007
I am attempting to do a directory 301 redirect with a .htacccess. I have followed the instructions but it is not working. I have heard that I will have to wait for Apache to restart on the server before it will work. Is this true?
View 3 Replies
View Related
Jul 10, 2009
I wasn't able to just export and import so I had to manually recreate content. I used the same permalink structure in hopes that I "might" be able to do a re-direct. Just now sure if A)It is possible or B)How to do it.
Example:
OLD LINK:
[url]
NEW LINK:
[url]
Am I able to redirect all traffic that comes in and replace the "www.cgcookie.com/articles" with "cg.cgcookie.com"?
View 4 Replies
View Related
Mar 13, 2008
I'm going to be doing some upgrades on my site and I want to redirect all users to a different page while I do the upgrades but I need to allow my self too have access.
I have done this before with a htaccess rule, but I can't remember what it was and can't seem to find it anywhere.
View 2 Replies
View Related
Jan 13, 2007
We had a subdomain that was [url]and we have now decided we would like to use [url]
I have setup the gallery on the new server as [url]
I would like to be able to if someone had a link [url]for it to redirect them too [url]
View 3 Replies
View Related
Jan 24, 2007
I want to redirect all requests for .pdf files from one dir to another.
OLD DIR: www.domain.com/en/product/pdf/
NEW DIR: www.domain.com/global_pdf/
...so when someone requests:
www.domain.com/en/product/pdf/john.pdf
it loads:
www.domain.com/global_pdf/john.pdf
I think I need to use RedirectMatch or RedirectRule to check for *.pdf but I have no idea how to write the expression matching thing.
View 2 Replies
View Related
May 19, 2007
I have 2 domains, [url]and [url]. Notice that the old one has www, and the new one doesn't.
I want to redirect ALL html pages from [url]to the page [url].
I have Googled a bit and found this code to use in the .htaccess file of the old domain:
RedirectMatch (.*).html$ [url]
However it does not work. It only redirects from [url]; it does not redirect from [url] or any internal pages.
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
Nov 26, 2006
I'm trying to redirect from a filename that contains spaces using .htaccess
for example, I want to redirect /test 2.html to http://example.com
I've tried:
ReDirect /test 2.html http://example.com
ReDirect /test 2.html http://example.com
ReDirect /"test 2".html http://example.com
ReDirect /'test 2'.html http://example.com
ReDirect /test%202.html http://example.com
ReDirect /"test 2.html" http://example.com
ReDirect /'test 2.html' http://example.com
And a few others. I can't seem to get the syntax right, and always end up getting an internal server error message. Anyone have any ideas?
View 6 Replies
View Related
Jun 16, 2009
if there is anyway to redirect my users to https no matter what page they are on using htaccess?
I really don't fancey using full url extentions and changing them on every link on my site. I can get the homepage to redirect to https but not any other.
If there is no way to do this does anyone know the shortest hyperlink to use the redirect?
View 7 Replies
View Related
Feb 25, 2008
could not find a solution for this reversed blocking
I would like to redirect users who access the site from any IP address to be redirected like this:
RedirectMatch /(.*)$ hxxp://extranet.domainname.com
and have anyone from an IP address of 123.123.123.123 to just access/view the regular site, so not to be redirected.
how I can do this in my .htaccess file?
View 4 Replies
View Related
Jul 17, 2007
I'm not to good with htaccess.
I am able to find information on the 2 items I am looking for separately but not together.
I need all pages on a site to redirect to the www ssl version of the page.
so..
[url] > [url]
[url]> [url]
[url]> [url]
View 3 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
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
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