| | |
Apache rewrite map
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Apr 2005
Posts: 4
Reputation:
Solved Threads: 0
Hi,
I want to take a shot at writing an Apache RewriteMap in PHP.
The example they give is in perl, which I don't know.
The perl example is here
http://httpd.apache.org/docs/mod/mod...#RewriteEngine
I'm not going to do anything to ambitious, but they do give a warning that
if you get it wrong you hang the server, so I was hoping someone can point me at a simple example of such a module in PHP, or give me a few pointers as to potential pitfalls. Or if anyone knows perl point me to the PHP equivalence.
Otherwise I'm going to have to learn a bit of perl ( which I really don't want to do ).
thanks
dave
I want to take a shot at writing an Apache RewriteMap in PHP.
The example they give is in perl, which I don't know.
The perl example is here
http://httpd.apache.org/docs/mod/mod...#RewriteEngine
I'm not going to do anything to ambitious, but they do give a warning that
if you get it wrong you hang the server, so I was hoping someone can point me at a simple example of such a module in PHP, or give me a few pointers as to potential pitfalls. Or if anyone knows perl point me to the PHP equivalence.
Otherwise I'm going to have to learn a bit of perl ( which I really don't want to do ).
thanks
dave
There is a pretty good tutorial here. There is also a tutorial here on Daniweb at this link that deals with rewriting for vbulletin. I haven't read the tutorial here on Daniweb, but I'm sure there are lots of questions and answers that may be helpful as it is a huge thread. I also assume you have had a look at the Apache URL Rewriting Guide, I found it very hard to follow :o Understand that you really aren't doing anything in PHP, you will be creating commands that the apache server interprets and executes itself.
Good luck.
Good luck.
•
•
Join Date: Apr 2005
Posts: 4
Reputation:
Solved Threads: 0
Thanks,
Actually I'm pretty close to cracking this one.
Not sure what you mean about "not doing anything in PHP" tho. I've written the Rewrite rules in PHP and made it into a shell script which Apache will read when it does a RewriteRule in .htaccess
I think it's near to working, only think I can't quite figure is the correct syntax for the rewrite rule.
Currently I have
RewriteRule \.(wmv)$ $(nohotlink
1)
where nohotlink is the name of my map.
I want to feed all files of type .wmv into my RewriteMap ( which is the PHP bit ). I'll go look at the tutorials now.
Thanks for the tip!
Actually I'm pretty close to cracking this one.
Not sure what you mean about "not doing anything in PHP" tho. I've written the Rewrite rules in PHP and made it into a shell script which Apache will read when it does a RewriteRule in .htaccess
I think it's near to working, only think I can't quite figure is the correct syntax for the rewrite rule.
Currently I have
RewriteRule \.(wmv)$ $(nohotlink
1)where nohotlink is the name of my map.
I want to feed all files of type .wmv into my RewriteMap ( which is the PHP bit ). I'll go look at the tutorials now.
Thanks for the tip!
•
•
Join Date: Apr 2005
Posts: 4
Reputation:
Solved Threads: 0
OK solved!
It was so late at night I didn't notice the ( and ) were { and }
RewriteEngine On
RewriteRule \.(wmv)$ ${nohotlink
1}
does the trick.
thanks all
I've been developing PHP for a few months now, and I like it. It's pretty easy and I've never really got stuck on anything, but it's nice to find a board to post to. I'll try to come back and maybe answer a few questions as well as ask em.
have a nice day!
It was so late at night I didn't notice the ( and ) were { and }
RewriteEngine On
RewriteRule \.(wmv)$ ${nohotlink
1}does the trick.
thanks all
I've been developing PHP for a few months now, and I like it. It's pretty easy and I've never really got stuck on anything, but it's nice to find a board to post to. I'll try to come back and maybe answer a few questions as well as ask em.
have a nice day!
![]() |
Similar Threads
- Looking to exchange links with PR5 sites or above (Relevant Link Exchanges)
- vBulletin mod_rewrite (PHP)
- Apache - Virtual Directory (Linux Servers and Apache)
- jsp will lost its session while subdomain-rewrite applied (JSP)
- apache.mod_rewite, while falgs[L] set but dead-loop met? (Linux Servers and Apache)
- Using map<> with classes (C++)
Other Threads in the PHP Forum
- Previous Thread: Contribute code
- Next Thread: need to update each records after record deleted
| Thread Tools | Search this Thread |
ajax apache api array basics beginner binary broken cakephp checkbox class cms code codingproblem combobox cron curl database date display domain dynamic echo email error file files folder form format forms function functions google href htaccess html image include insert interactive ip java javascript joomla js limit link load login mail malfunctioning menu mlm mobile multiple mysql nodes oop outofmemmory paging parse paypal pdf php problem procedure query radio ram random recursion reference remote return script search server sessions sms source space sql syntax system table tutorial unset up-to-date update upload url validation validator variable video web webapplications websitecontactform youtube





