Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-27-2012, 08:40 AM   PM User | #1
UltimateCoder
New Coder

 
Join Date: Dec 2011
Posts: 67
Thanks: 20
Thanked 1 Time in 1 Post
UltimateCoder is an unknown quantity at this point
Way to automatically update .htaccess?

I was wondering if there is a way to automaticly update a .htaccsess file. Prehaps using PHP fopen() & fwrite().

What I would like to be able to do is allow users to create a new article, but I need a way to redirect the domain path they wanted to a page like article.php?id=56985689.

For ovbious reasons I don't want to do this by hand, so I was wondering if there is a way to automate this? Any ideas?
UltimateCoder is offline   Reply With Quote
Old 04-27-2012, 06:40 PM   PM User | #2
MarkR
New Coder

 
Join Date: Sep 2011
Posts: 80
Thanks: 0
Thanked 13 Times in 12 Posts
MarkR is an unknown quantity at this point
Yep, you pretty much answered your own question by suggesting fwrite.

What exactly are you trying to achieve? There maybe a simpler solution.
__________________
Web Design Newcastle
MarkR is offline   Reply With Quote
Old 04-27-2012, 08:14 PM   PM User | #3
Alex Vincent
Moderator


 
Join Date: May 2002
Location: Hayward, CA
Posts: 1,427
Thanks: 1
Thanked 19 Times in 17 Posts
Alex Vincent is on a distinguished road
Uh, I'd think twice about rewriting .htaccess dynamically. That's extremely risky, especially if there's a security vulnerability in your website. You don't want someone else to take control of .htaccess, do you?
__________________
"The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
June 30, 2001
author, Verbosio prototype XML Editor
author, JavaScript Developer's Dictionary
https://alexvincent.us/blog
Alex Vincent is offline   Reply With Quote
Old 04-27-2012, 10:10 PM   PM User | #4
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,650
Thanks: 4
Thanked 2,451 Times in 2,420 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Agreed. While it can be done, its not exactly the wisest.
Find a common format, and use the rewrite engine to send it to article.php?id=xxxx.
Fou-Lu is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:12 PM.


Advertisement
Log in to turn off these ads.