473,326 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Htaccess not redirecting Properl

Hello there I have a question. There is a website that has multiple domains pointing to the same ip. I want to redirect someone if they put a proper "code" after the url to a "secret" site.
i.e. www.example1.com and www.example2.com both point to 1.1.1.1 and if you type www.example1.com/secret it redirects you to www.example1.com/secretarea/secret.php. Now I have that part working just fine but if you type in www.example2.com/secret I get a Not Found page instead of secret.php

I'm not sure why this isn't working. Any tips would be appreciated thanks.
May 31 '07 #1
4 1958
Banfa
9,065 Expert Mod 8TB
How are you doing the redirect?
May 31 '07 #2
Motoma
3,237 Expert 2GB
Hello there I have a question. There is a website that has multiple domains pointing to the same ip. I want to redirect someone if they put a proper "code" after the url to a "secret" site.
i.e. www.example1.com and www.example2.com both point to 1.1.1.1 and if you type www.example1.com/secret it redirects you to www.example1.com/secretarea/secret.php. Now I have that part working just fine but if you type in www.example2.com/secret I get a Not Found page instead of secret.php

I'm not sure why this isn't working. Any tips would be appreciated thanks.
Typically the way multiple domains are handled is through a VirtualHost directive in Apache. If this is the case then www.example1.com and www.example2.com will actually be pointing to different files on the server. If this is not the case, let me know immediately.

If you want the redirect to happen regardless of the domain used to get to the server, you will need to place a mod_rewrite directive in one of Apache config areas that have a global scope. You can check the Apache online documentation for mod_rewrite to get the exact config files you can place this in.
Jun 1 '07 #3
This is the redierct i'm using in the .htaccess file I'm pretty sure my host is using virtual hosts but i dont have access to the conf file on the actual web host.
RedirectPermanent /box220 http://www.example1.com/secretarea/secret.phpt

I'll try to use the rewrite engine and see if that helps
Jun 1 '07 #4
Motoma
3,237 Expert 2GB
This is the redierct i'm using in the .htaccess file I'm pretty sure my host is using virtual hosts but i dont have access to the conf file on the actual web host.
RedirectPermanent /box220 http://www.example1.com/secretarea/secret.phpt

I'll try to use the rewrite engine and see if that helps
You will have to put the working .htaccess in the webroot of both virtual hosts.
Jun 1 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: yawnmoth | last post by:
i'm trying to write a php script that will password protect some random directory by creating a .htaccess file, and a password file to accompany the .htaccess file, and it isn't working... ...
8
by: Joshua Beall | last post by:
Hi All, How do I disable magic quotes via .htaccess? I put the following file in my webroot, but it does not disable magic_quotes_gpc (according to phpinfo(), both the local and master value...
4
by: Ivo | last post by:
Greetings newsgroup, I am moving some php scripts to a new host. While getting to know the server, I ran into a strange problem. If I add a .htaccess file, or more specifically: a .htaccess with...
7
by: John | last post by:
Hello. I want to get this blasted .htaccess file sorted out, so I can have sessions without register_globals being on. I have looked everywhere for info on this and I mean everywhere...
3
by: Vardan Kushnir | last post by:
Please forgive me if my English is poor. Also please tell me if this is wrong place to ask this question and tell me better place. When searching web for information Re: .htaccess and...
0
by: Jack Hambabo | last post by:
Hi, I'm searching for a php script that can find out whether the current user (I know _SERVER will give me the name for non-cgi php) has the right to view a specific file. My dream is that I...
8
by: Morpheus | last post by:
I am trying to test a function that outputs text to the standard output, presumably using a cout call. I do not have access to the source, but need to test the output. Is this possible? I can...
1
by: nickyeng | last post by:
I have checked this info from apache website, and i confused with it. Procteing System files it said: To run a really tight ship, you'll want to stop users from setting up .htaccess files...
2
Markus
by: Markus | last post by:
Why is it not working? I joke. Here's the info: In the folder C:\host\www\test, I have an .htaccess file. Inside that .htaccess file is the following: RewriteEngine On RewriteRule...
2
by: knkk | last post by:
I want to redirect a url http://abc.xyz.com/123 to http://www.xyz.com. So the file that will be accessed will be index.php of xyz.com. That index.php should have available to it both abc and 123 (so...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.