SharkBait Posted August 27, 2010 Share Posted August 27, 2010 When you don't do something for a long time.. it slips from you! Or at least it does for me. RewriteRule ^([A-za-z]+)$ index.php?dir=$1 [L] What I want to accomplish is: blah.com/pix/Tree or blah.com/pix/Tugboat the index.php file within /pix will use the Tugboat or Tree as variables (via GET). Though.. the tricky part is that Tree an Tugboat will actually be directories with photos in them. The idea was to have /pix handle URL requests to display the photos within the specified directories. I don't want people to access the directories. Can it be done? Can we trick Apache into thinking there are no directories, when there are? Just creating a really quick and easy photo thing for myself. All i have to do is drop the photos into a directory and then blah.com/pix/racecar will allow me to display the photos within that directory via the index.php file that will style the single page. Quote Link to comment https://forums.phpfreaks.com/topic/211909-getting-rewrite-to-work-properly/ Share on other sites More sharing options...
dreamwest Posted August 28, 2010 Share Posted August 28, 2010 use a separate .htaccess in the real directories /.htaccess /pix/.htaccess Anyway i dont think its possible to block access to the actual images by using a redirect without the image not showing up, this only works with included files Quote Link to comment https://forums.phpfreaks.com/topic/211909-getting-rewrite-to-work-properly/#findComment-1104516 Share on other sites More sharing options...
SharkBait Posted August 28, 2010 Author Share Posted August 28, 2010 What I decided to do was rename the directories to have a character similar to them blahblah-p and then when someone goes to blah.com/pix/blahblah it will pull the files from blahblah-p directory if it exists. *shrug* Quote Link to comment https://forums.phpfreaks.com/topic/211909-getting-rewrite-to-work-properly/#findComment-1104609 Share on other sites More sharing options...
PradeepKr Posted September 5, 2010 Share Posted September 5, 2010 May be this is what you are looking for, IndexIgnore * Check stop indexing for more info. Quote Link to comment https://forums.phpfreaks.com/topic/211909-getting-rewrite-to-work-properly/#findComment-1107467 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.