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 ^test1.php$ /test2.php [R]
-
If I then go to the url htxp://localhost/test/test1.php, I am redirected to htxp://localhost/test2.php - I thought that this would redirect me to htxp://localhost/test/test2.php? Clearly not. If I removed the forward slash before the 'test2.php', I am redirected to htxp://localhost/C:/host/www/l/test2.php
I am running EasyPHP 3.
Here's the httpd.conf info that I think relates to this problem: -
#
-
# DocumentRoot: The directory out of which you will serve your
-
# documents. By default, all requests are taken from this directory, but
-
# symbolic links and aliases may be used to point to other locations.
-
#
-
DocumentRoot "${path}/www"
-
-
#
-
# Each directory to which Apache has access can be configured with respect
-
# to which services and features are allowed and/or disabled in that
-
# directory (and its subdirectories).
-
#
-
# First, we configure the "default" to be a very restrictive set of
-
# features.
-
#
-
<Directory />
-
Options FollowSymLinks
-
AllowOverride none
-
Order allow,deny
-
Deny from all
-
</Directory>
-
-
#
-
# Note that from this point forward you must specifically allow
-
# particular features to be enabled - so if something's not working as
-
# you might expect, make sure that you have specifically enabled it
-
# below.
-
#
-
-
#
-
# This should be changed to whatever you set DocumentRoot to.
-
#
-
<Directory "${path}/www">
-
#
-
# Possible values for the Options directive are "None", "All",
-
# or any combination of:
-
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
-
#
-
# Note that "MultiViews" must be named *explicitly* --- "Options All"
-
# doesn't give it to you.
-
#
-
# The Options directive is both complicated and important. Please see
-
# http://httpd.apache.org/docs/2.2/mod/core.html#options
-
# for more information.
-
#
-
Options Indexes FollowSymLinks
-
-
#
-
# AllowOverride controls what directives may be placed in .htaccess files.
-
# It can be "All", "None", or any combination of the keywords:
-
# Options FileInfo AuthConfig Limit
-
#
-
AllowOverride All
-
-
#
-
# Controls who can get stuff from this server.
-
#
-
Order allow,deny
-
Allow from all
-
-
</Directory>
2 2647
And what happens if you put - RewriteRule ^test1.php$ /test/test2.php [R]
?
Ah, yes. That works. I just thought that it would redirect to the same directory the htaccess file was in? I guess not.
Thanks, r0.
Sign in to post your reply or Sign up for a free account.
Similar topics
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... ...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
by: Doug Laidlaw |
last post by:
Jerry Stuckle wrote:
I have never used anything but Apache, but I didn't know that .htaccess was
server-specific. How does Windows do it?
Doug.
|
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...
|
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...
|
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...
|
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...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
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...
|
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....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |