Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Closed Thread
htaccess catch-all - process in PHP
Old 07-08-2009, 08:41 AM htaccess catch-all - process in PHP
Galaxian's Avatar
Rich Powell

Posts: 842
Name: Rich Powell
Location: United Kingdom
Trades: 0
How would one go about catching all that is in the address after the domain name and passing it to a PHP variable in a handling script?

Basically I want PHP to process the URLs, I just have trouble with the htaccess code to pass the address onto the GET variable.

So example:

http://www.example.com/test/me/1.html

Would go to:

http://www.example.com/handle.php?req=test/me/1.html
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Please help get the new
Please login or register to view this content. Registration is FREE
forum started for Webmasters like you!


Last edited by Galaxian; 07-08-2009 at 08:46 AM..
Galaxian is offline
View Public Profile Visit Galaxian's homepage!
 
 
Register now for full access!
Old 07-08-2009, 10:25 AM Re: htaccess catch-all - process in PHP
Galaxian's Avatar
Rich Powell

Posts: 842
Name: Rich Powell
Location: United Kingdom
Trades: 0
Can't find in w3schools

and also can't find this in google. I can find other thing's similar but not this.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Please help get the new
Please login or register to view this content. Registration is FREE
forum started for Webmasters like you!

Galaxian is offline
View Public Profile Visit Galaxian's homepage!
 
Old 07-09-2009, 09:05 AM Re: htaccess catch-all - process in PHP
Galaxian's Avatar
Rich Powell

Posts: 842
Name: Rich Powell
Location: United Kingdom
Trades: 0
Bump ?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Please help get the new
Please login or register to view this content. Registration is FREE
forum started for Webmasters like you!

Galaxian is offline
View Public Profile Visit Galaxian's homepage!
 
Old 07-09-2009, 01:01 PM Re: htaccess catch-all - process in PHP
orionoreo's Avatar
Ultra Talker

Posts: 335
Name: Jerry
Trades: 0
if all pages goes to test then it would probably be

Code:
RewriteRule (test)\/([a-z]+)\/([0-9]+)\.html handle.php?req=$1/$2/$3.html
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
orionoreo is offline
View Public Profile
 
Old 07-09-2009, 01:08 PM Re: htaccess catch-all - process in PHP
orionoreo's Avatar
Ultra Talker

Posts: 335
Name: Jerry
Trades: 0
here's a revision that will maybe work better? i'm not sure i just picked up htaccess last week

Code:
RewriteRule (test|another)\/([^/]+)\/([^/]|[0-9]+)\.html handle.php?req=$1/$2/$3.html
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
orionoreo is offline
View Public Profile
 
Old 07-09-2009, 04:29 PM Re: htaccess catch-all - process in PHP
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
I haven't tested, but I think something like this might work...

Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ handle\.php?req=$1&%{QUERY_STRING} [L]
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
View Public Profile
 
Old 07-09-2009, 05:33 PM Re: htaccess catch-all - process in PHP
hairygunther's Avatar
Extreme Talker

Posts: 164
Trades: 0
If you have superuser access of any kind you should be making these adjustments in the httpd.conf file, wherever that may live (it depends on your installation).

I have checked numerous sites and all these changes are perfectly possible in the main configuration file, where they are safer, and better regulated (well, you don't leave a trail of security footprints all over the place, drawing attention to these areas for the benefit of those who seek easy western targets, looking on from South America and the Far East).

I bet our porn sites are better protected, in the west, than our banks - against unprofessionally handled server software... well the porn administrators have had a lot of experience. They were making money out of the web before anyone else was!
__________________
I acknowledge Parker out of Thunderbirds and Glaxo Industries.
hairygunther is offline
View Public Profile
 
Old 07-15-2009, 05:45 AM Re: htaccess catch-all - process in PHP
Lashtal's Avatar
wherenomanhasgonebefore

Posts: 680
Name: Lashtal
Trades: 0
Yes they were, but the lot of 'em are terrible at what they do.

The numerous billing software exploits over the years (which I wont name), and the brute force attacks against member's areas- widely distributed by the hackers to the general public.

They are some of the most targeted, due to the fact that some of these sites have an unheard of # of CC's on record.
__________________
Currently Reading:
Please login or register to view this content. Registration is FREE
Lashtal is offline
View Public Profile
 
Closed Thread     « Reply to htaccess catch-all - process in PHP
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.34962 seconds with 12 queries