Current location: Hot Scripts Forums » Programming Languages » PHP » .htaccess and PHP Redirect problem


.htaccess and PHP Redirect problem

Reply
  #1 (permalink)  
Old 06-19-05, 10:31 PM
dodod dodod is offline
Newbie Coder
 
Join Date: Dec 2004
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
.htaccess and PHP Redirect problem

I've been hiding the extension of my php files using the following setup in my .htaccess

<Files FILENAME>
ForceType application/x-httpd-php
</Files>


I don't allow outsiders to view some of these files using a Restrict() function which just redirects using header("location: Restricted.html"); if a cookie is not found... this works for the files like www.mywebsite.com/Example but the reason i did this was to hide variables in the urls like www.mywebsite.com/Example/539 ...when there is an ending like the above I get a message saying the Redirection Limit For this URL exceeded. It works without the hidden variable. So I'm wondering what can be done about this problem

Thanks,
dododododododdodododod
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 06-19-05, 11:39 PM
jordie jordie is offline
Wannabe Coder
 
Join Date: Jun 2005
Posts: 179
Thanks: 0
Thanked 0 Times in 0 Posts
you could just put this in ur .htaccess file for the changing of url:

Code:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)/[0-9]* $1.php?id=$2
Haven't test that myself, but you could also be specific and try:
Code:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^Example/[0-9]* Example.php?id=$2
__________________
Jordie Bodlay
php, mysql, postgres
css, xhtml
graphics, design
email me: jb2386@hotmail.com for any programming needs.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 06-19-05, 11:54 PM
dodod dodod is offline
Newbie Coder
 
Join Date: Dec 2004
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
When I tried that, it went to the "Example" document but $_REQUEST['id'] wouldnt return anything- so I guess I'd have to do the same thing (take out the $PATH_INFO to make the variable ) and the same problem would probably still exist (*unless im doing something wrong).

I dont really have an understanding of .htaccess stuff
maybe if i make the location: /index.php..


thanks
-dodododododo
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 06-19-05, 11:56 PM
dodod dodod is offline
Newbie Coder
 
Join Date: Dec 2004
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
oh wow, that worked.
hehe
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
can someone help with htaccess and php problem tigherrdk PHP 6 03-09-09 03:28 AM
PHP script problem (please help) osmanmumtaz PHP 0 05-24-05 08:29 AM
php variable problem ashishjha54 PHP 7 05-22-05 01:09 PM
Can anyone help me ? (problem using php variables in html db insert code) chronic_ PHP 2 06-13-04 12:19 PM
Using crond to run a php script with redirect and refresh php_newbie PHP 2 02-09-04 01:03 PM


All times are GMT -5. The time now is 07:04 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.