TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 07-07-2009, 07:41 PM   #1 (permalink)
The Acquainted
 
Randy's Avatar
 
Join Date: May 2007
Location: Your G/F's Closet
Posts: 114
Thanks: 7
Randy is on a distinguished road
Default Files appear as folders?

So I think you would need to use .htaccess to make this work but wasnt sure where to put it so i put it in here.

Anyways I am trying to make my index.php appear as /index/ and about.php appear as /about/ and then if i put a file into a folder i create called about it comes out as /about/datacenter/

Example:
index.php = /index/
about.php = /about/
about/datacenter.php = /about/datacenter/

But i only want it to do it on certain files and folders as I do not want it to mess up other folders such as my whmcs install.

Any clue how I would do this?

Thanks,
Randy
__________________
Real Programmers always confuse Christmas and Halloween because Oct31 == Dec25 - Andrew Rutherford
Send a message via AIM to Randy Send a message via MSN to Randy
Randy is offline  
Reply With Quote
Old 07-07-2009, 10:53 PM   #2 (permalink)
The Contributor
 
cecilia's Avatar
 
Join Date: May 2009
Location: LA, CA
Posts: 87
Thanks: 0
cecilia is on a distinguished road
Default

oops, sorry it seems applied to a non-index file it displays the file name too so it doesnt work. Sorry

Last edited by cecilia : 07-07-2009 at 11:30 PM.
cecilia is offline  
Reply With Quote
Old 07-08-2009, 03:34 AM   #3 (permalink)
The Acquainted
 
Randy's Avatar
 
Join Date: May 2007
Location: Your G/F's Closet
Posts: 114
Thanks: 7
Randy is on a distinguished road
Default

Alright so I know you use mod_rewrite but i have yet to find a tutorial that explains it good..
__________________
Real Programmers always confuse Christmas and Halloween because Oct31 == Dec25 - Andrew Rutherford
Send a message via AIM to Randy Send a message via MSN to Randy
Randy is offline  
Reply With Quote
Old 07-08-2009, 03:14 PM   #4 (permalink)
The Contributor
 
cecilia's Avatar
 
Join Date: May 2009
Location: LA, CA
Posts: 87
Thanks: 0
cecilia is on a distinguished road
Default

OK I tried a different approach, not sure if this is ok.

What I did:
1. made a folder named testing
2. made a file named index.php inside testing folder
3. made an anchor on another page that points to just the folder: 'testing/'
4. It opens a page but it just displays ...testing/ on the URL

I know the file name is index.php but does it matter? It is still a page and it does display the folder name alone. I mean the output looks the same.


To get:
/about/datacenter/

Would be:
about/datacenter/index.php


Well, this is all I can think of right now, sorry if it doesnt work for you.
cecilia is offline  
Reply With Quote
Old 07-08-2009, 06:20 PM   #5 (permalink)
The Acquainted
 
Randy's Avatar
 
Join Date: May 2007
Location: Your G/F's Closet
Posts: 114
Thanks: 7
Randy is on a distinguished road
Default

I know that way that is how the current site looks :p I am looking to make it easier on me to not have soo many actual folders.
__________________
Real Programmers always confuse Christmas and Halloween because Oct31 == Dec25 - Andrew Rutherford
Send a message via AIM to Randy Send a message via MSN to Randy
Randy is offline  
Reply With Quote
Old 07-08-2009, 06:55 PM   #6 (permalink)
The Acquainted
 
Randy's Avatar
 
Join Date: May 2007
Location: Your G/F's Closet
Posts: 114
Thanks: 7
Randy is on a distinguished road
Default

Alright so I finally figured it out, but the site i got it from is EXTREMELY confusing so Ill give it to yall in short.

create your .htaccess file

and turn the rewrite engine with the following code:
PHP Code:
RewriteEngine On 
then lets create our rewrite rule of which file we want to be which folder with the following line:
PHP Code:
RewriteRule ^spacespace.html 
space.html will be the name of the file you want to change and and where it says ^space$ simply change the 'space' part to what you want it to appear as.

Tada!



Thanks for help tho cecilia.
__________________
Real Programmers always confuse Christmas and Halloween because Oct31 == Dec25 - Andrew Rutherford
Send a message via AIM to Randy Send a message via MSN to Randy
Randy is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Retrieving Files from a Backup in Vista CMellor The Lounge 2 06-24-2008 02:34 PM
Best editor for large files? Brook General 7 05-31-2008 09:09 PM
Zend Framework required files freenity Absolute Beginners 1 04-06-2008 05:13 PM
Notepage like application to open large MySQL files Wildhoney General 6 12-07-2007 02:18 PM
Uploading Files with PHP daz Absolute Beginners 3 09-30-2007 06:23 PM


All times are GMT. The time now is 07:31 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design