forchilli Posted September 7, 2007 Share Posted September 7, 2007 I know there is a way of doing this. Most sites that you navigate to everyday, have this done to there URL's.My site now is "http://zakkforchilli.com/contact.html"what i want is "http://zakkforchilli.com/contact/"thats what i want to show up in the address bar. anyone know how exactly i would go about this ??thanks.[examples]http://pownce.com/zakkforchilli/ ISNT http://pownce.com/zakkforchilli.htmlhttp://myspace.com/username/ ISNT http://myspace.com/username.html Link to comment Share on other sites More sharing options...
vijay Posted September 7, 2007 Share Posted September 7, 2007 Hi.. For that you have to code such that that can redirect the page automatically on desire page.. you have to 4 serverscript for this.. or you can go for rewrite rule from this you can make rules and redirect page..rewrite riles in apache..Something like below this:RewriteCond %{HTTP_HOST}/contactRewriteRule %{HTTP_HOST}/contact %{HTTP_HOST}/contact.html-Vijay Link to comment Share on other sites More sharing options...
aspnetguy Posted September 7, 2007 Share Posted September 7, 2007 This is done with the .htaccess file not serverside scripting. Look up mod_rewrite for apache. Link to comment Share on other sites More sharing options...
Synook Posted September 7, 2007 Share Posted September 7, 2007 Or you could just restructure your directories so that you have a structure ./contact/index.html where index.html was the previous contact.html, and then people could access ./contact/ to view your page. But then you would have to change your links. Link to comment Share on other sites More sharing options...
forchilli Posted September 7, 2007 Author Share Posted September 7, 2007 well im a noob when it comes to apache and stuff. so how would i go about using that rewrite rule ?? Link to comment Share on other sites More sharing options...
croatiankid Posted September 7, 2007 Share Posted September 7, 2007 searching the internet would be a good start. Link to comment Share on other sites More sharing options...
justsomeguy Posted September 7, 2007 Share Posted September 7, 2007 You don't need to use rewriting for this. Like Synook said, if you name your file index.html or index.php (whatever it needs to be), and put it in the contact directory, then going to /contact/ would load the index file. Link to comment Share on other sites More sharing options...
forchilli Posted September 7, 2007 Author Share Posted September 7, 2007 @justsomeguy - now i understand! thanks alot. always a big help on the forum.EDIT - it worked! i just had to change up everything to have ../contact [etc]thanks very much! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.