Link to home
Create AccountLog in
Apache Web Server

Apache Web Server

--

Questions

--

Followers

Top Experts

Avatar of Amit Kumar
Amit Kumar

Rewriterule PT flag
I am trying to understand how PT flag actually works
I have gone through this page
http://httpd.apache.org/docs/2.4/rewrite/flags.html#flag_pt
and http://borkweb.com/story/apache-rewrite-cheatsheet
As I observe , specially as per later url where example is like
RewriteRule ^/abc(.*) /def$1 [PT]
Alias /def /ghi

Open in new window


I modified 2 things in the example
1. removing / forward slash from pattern in the first line as / lets not match pattern with url
2. changed Alias with Redirect or Redirectmatch

so my .htaccess file located at my local server under Applications/AMPPS/www/h/ or http://localhost/h 
looks like :

RewriteRule ^abc /h/def [PT]
Redirect /h/def /ghi

Open in new window


with or without PT , I got same results( finally redirects to http://localhost/ghi which is pretty expected ).
same with another example i tried, which is something like :

Redirect /h/icons /hello
RewriteRule pics/(.+)\.jpg$ /h/icons/$1.jpg

Open in new window


that finally redirects to http://localhost/hello 

so I am not getting any idea how PT makes a difference while talking in perspective of .htaccess file, mod_rewrite and mod_alias.

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of gheistgheist🇧🇪

Are you looking for RedirectMatch  statement?

ASKER CERTIFIED SOLUTION
Avatar of Amit KumarAmit Kumar

ASKER

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

I have found solution my own

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.

Apache Web Server

Apache Web Server

--

Questions

--

Followers

Top Experts

The Apache HTTP Server is a secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards. Typically Apache is run on a Unix-like operating system, but it is available for a wide variety of operating systems, including Linux, Novell NetWare, Mac OS-X and Windows. Released under the Apache License, Apache is open-source software.