icon Learn how to get the most out of Surmunity - read our forum tips here! | Welcome! Please register to access all of our features.

» Surpass Web Hosting Forums » Discussions » PHP, MySQL » PHPsuexec » .htacess rename engine?

PHPsuexec Information and tips

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread
Old January 10th, 2007, 11:07 AM   #1 (permalink)
Registered User
Comfy Contributor
 
Joined in Jun 2006
106 posts
Gave thanks: 5
Thanked 1 Time in 1 Post
.htacess rename engine?

i have a bunch of .html files on a site, and i'd like to change it so that i can type in site.com/index and it'll know to look up index.html

any ideas?

thanks!
Savesheep is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old January 10th, 2007, 11:11 AM   #2 (permalink)
Skittles
Super #1
 
DewKnight's Avatar
 
Joined in Aug 2004
Lives in Space ship
Hosted on dedi
6,480 posts
Gave thanks: 91
Thanked 176 times
You can do this with mod_rewrite. I haven't been able to figure it out with the quick looks I've taken at it, but that will give you an idea of what you are searching for. You can also check on http://www.modrewrite.com/ to learn more about it. I'm sure one of the members here can give you exactly what you need to use though
__________________
Mountain Dew Knight
People should not be afraid of their governments. Governments should be afraid of their people.
DewKnight is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old January 10th, 2007, 9:03 PM   #3 (permalink)
Surpass Fan
Super #1
 
Joined in Aug 2004
Hosted on SH58
1,687 posts
Gave thanks: 6
Thanked 7 times
Something like this in your .htaccess file:

Code:
RewriteEngine On
RewriteBase /
RewriteRule ^[a-zA-Z0-9_\-]$ $1.html
Very primitive example, and I did it from memory. No guarantee as to whether it works or not.
__________________
- Evan Charlton | [site] | Server - SH58
Kickersny.com is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old January 10th, 2007, 9:11 PM   #4 (permalink)
Registered User
Comfy Contributor
 
Joined in Jun 2006
106 posts
Gave thanks: 5
Thanked 1 Time in 1 Post
:/ - it didn't work. It looks right though!

somewhere in there i define files that shouldn't be redefined, right? like [jpg|gif|png|swf] etc etc?
Savesheep is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old January 11th, 2007, 12:24 AM   #5 (permalink)
Surpass Fan
Super #1
 
Joined in Aug 2004
Hosted on SH58
1,687 posts
Gave thanks: 6
Thanked 7 times
Try simplifying the last line to this:
Code:
RewriteRule ^[a-zA-Z0-9]$ $1.html
Anyone out there with more experience?
__________________
- Evan Charlton | [site] | Server - SH58
Kickersny.com is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old January 13th, 2007, 9:22 PM   #6 (permalink)
H
after g, before i
Super #1
 
H's Avatar
 
Joined in Jul 2004
Hosted on Gojira
7,870 posts
Gave thanks: 44
Thanked 127 times
Code:
RewriteRule ^([a-zA-Z0-9])/?$ $1.html
H is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old January 14th, 2007, 2:20 AM   #7 (permalink)
Surpass Fan
Excelling Contributor
 
cowboy's Avatar
 
Joined in Nov 2005
Lives in Colorado
Hosted on DEDI
924 posts
Gave thanks: 2
Thanked 91 times
Quote:
Originally Posted by H View Post
Code:
RewriteRule ^([a-zA-Z0-9])/?$ $1.html
This is fine if there are no sub directories with an index file for default delivery without any file name specified in them. It would redirect a call for this_directory/subdirectory/ to this_directory/subdirectory.html because of the /? in the pattern.

RewriteRule ^(index)$ $1.html for only an index append of .html or

RewriteRule ^([a-zA-Z0-9])$ $1.html for an append of .html for any filename without an extention.
__________________
Where would you be if you were at the highest court in the land (US)?
cowboy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
This user thanks cowboy for this great post!
Savesheep (January 15th, 2007)
Old January 14th, 2007, 2:25 AM   #8 (permalink)
H
after g, before i
Super #1
 
H's Avatar
 
Joined in Jul 2004
Hosted on Gojira
7,870 posts
Gave thanks: 44
Thanked 127 times
Could always through in:

Code:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
H is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old January 15th, 2007, 8:36 AM   #9 (permalink)
Registered User
Comfy Contributor
 
Joined in Jun 2006
106 posts
Gave thanks: 5
Thanked 1 Time in 1 Post
Quote:
Originally Posted by H View Post
Could always through in:

Code:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f

What does this do?
Savesheep is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
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 edit your posts

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