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.

Website Design Forum


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



Freelance Jobs

Reply
Old 02-25-2007, 11:26 AM Help with URLs
Junior Talker

Posts: 15
Trades: 0
Ok so I need a little bit of help here again, mainly with making a site with urls more comprehensible...ex:

mysite.com/main.html

but what I want is mysite.com/main

I am trying to do this with mod_rewrite (running apache) and my .htaccess, but I am not having much luck. Btw my domain and hosting are with GoDaddy.

Thanks for the help!

oh and btw, i'm trying to avoid simply doing folders and in each folder using the "index.html" method...
evilknny9 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-25-2007, 12:47 PM
Ultra Talker

Posts: 407
Trades: 1
.htaccess
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^main$ main.html [L]
RewriteRule ^contact$ contact.html [L]
RewriteRule ^information$ information.html [L]
</IfModule>
You would just add a RewriteRule for every page.
__________________
[
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
]
Lucas3677 is offline
Reply With Quote
View Public Profile Visit Lucas3677's homepage!
 
Old 02-25-2007, 06:39 PM
jhuskisson's Avatar
Junior Talker

Posts: 47
Trades: 0
You could also use the following:

Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(main|contact|information)$ $1.html [L]
</IfModule>
It would mean only one line of code, and you'd only need to add in a new page into the brackets
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
jhuskisson is offline
Reply With Quote
View Public Profile Visit jhuskisson's homepage!
 
Old 02-25-2007, 08:38 PM
Junior Talker

Posts: 15
Trades: 0
lol thanks for the help, but that actually wasn't what I needed help with:blush: my real problem is that godaddy isn't working with my .htaccess file, and it just chooses to ignore it for some reason:blink: I'm 98% positive mod_rewrite is enabled, however no matter what I put in my .htaccess file, nothing ever changes...its as though the file weren't even there:censored:
evilknny9 is offline
Reply With Quote
View Public Profile
 
Old 03-06-2007, 03:24 PM
Skilled Talker

Posts: 52
Location: Kelowna, BC
Trades: 0
try doing a phpinfo(); to see if it's listed as being enabled. if it's not working right now and you've edited the .htaccess file properly, i'd assume it's because the mod_rewrite is not enabled.
__________________

Please login or register to view this content. Registration is FREE
jacob is offline
Reply With Quote
View Public Profile Visit jacob's homepage!
 
Reply     « Reply to Help with URLs
 

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.20605 seconds with 12 queries