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

Posts: 15
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
 
When You Register, These Ads Go Away!
     
Old 02-25-2007, 11:47 AM
Ultra Talker

Posts: 408
.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.
Lucas3677 is offline
Reply With Quote
View Public Profile Visit Lucas3677's homepage!
 
Old 02-25-2007, 05:39 PM
jhuskisson's Avatar
Junior Talker

Posts: 47
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
jhuskisson is offline
Reply With Quote
View Public Profile Visit jhuskisson's homepage!
 
Old 02-25-2007, 07:38 PM
Junior Talker

Posts: 15
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, 02:24 PM
Experienced Talker

Posts: 38
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.
jacob is offline
Reply With Quote
View Public Profile Visit jacob's homepage!
 
Reply     « Reply to Help with URLs
 

Thread Tools

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 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.13821 seconds with 13 queries