Markus 6,050
Recognized Expert Expert Why is it not working?
I joke. Here's the info:
In the folder C:\host\www\tes t, 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 2661
And what happens if you put - RewriteRule ^test1.php$ /test/test2.php [R]
?
Markus 6,050
Recognized Expert Expert
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... specifically, i
can't enter the newly created directory with a username of test, and a
password of test, which is what i am trying to do.
also, i'm testing this script out on a remote server, and... after
this script runs, i can't delete any of the...
|
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
content, to a folder, requesting (html and php) files from that folder
results in internal server error messages.
If I upload an empty .htaccess file, all is fine. Then phpinfo() tells
me I am using Apache/1.3.27.
|
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
including the php.net manual.
In the manual it said to include something like the following:
|
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 redirecting,
I see many different examples of methods.
I wish to be able to say "this is good method that I can always use"
even if exists other good methods.
I wish not be confused by many different examples of methods.
|
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 just need a short php script that just asks the
webserver what the rights are. That seems a reasonable wish to me.
If this is however not possible than I'd like a script that can
| |
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 technically create an executable that calls the function and then
using a command prompt call the exexutable using the > output.txt
redirector but I would prefer to do everything within the application
itself. Is there a way for force an output...
|
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 which can override security features you've configured. Here's one way to do it.
In the server configuration file, put
|
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 123 will be $_SERVER, and abc will come out of $_SERVER) to enable appropriate processing.
http://abc.xyz.com already goes to http://www.xyz.com (though configuration by my service provider), and abc can be extracted out of $_SERVER. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |