manix Posted August 1, 2011 Share Posted August 1, 2011 Hey.. I've noticed how some websites have links with no file extensions at the end for example "www.somesite.com/home" and I thought that was done with some kind of other domains (before I read an article about subdomains addon domains and parked domains) and now I am absolutely clueless on how to do this. I'll be glad if someone enlightens me Quote Link to comment https://forums.phpfreaks.com/topic/243484-domains-or-not-rly/ Share on other sites More sharing options...
ZulfadlyAshBurn Posted August 1, 2011 Share Posted August 1, 2011 use htaccess rewrite rule. link Quote Link to comment https://forums.phpfreaks.com/topic/243484-domains-or-not-rly/#findComment-1250209 Share on other sites More sharing options...
manix Posted August 1, 2011 Author Share Posted August 1, 2011 Okay I just took some time to educate myself about htaccess and after giving it a shot I realized that it would redirect any non-existing link to mysite.com/new and I don't need that. I only need mysite.com/new to display the file new.php, and like mysite.com/ne wouldn't display anything Quote Link to comment https://forums.phpfreaks.com/topic/243484-domains-or-not-rly/#findComment-1250229 Share on other sites More sharing options...
ZulfadlyAshBurn Posted August 1, 2011 Share Posted August 1, 2011 htaccess is how you go about it there is probably no other way. Quote Link to comment https://forums.phpfreaks.com/topic/243484-domains-or-not-rly/#findComment-1250235 Share on other sites More sharing options...
manix Posted August 1, 2011 Author Share Posted August 1, 2011 okay then thanks Quote Link to comment https://forums.phpfreaks.com/topic/243484-domains-or-not-rly/#findComment-1250246 Share on other sites More sharing options...
ZulfadlyAshBurn Posted August 1, 2011 Share Posted August 1, 2011 np Quote Link to comment https://forums.phpfreaks.com/topic/243484-domains-or-not-rly/#findComment-1250248 Share on other sites More sharing options...
gizmola Posted August 1, 2011 Share Posted August 1, 2011 Hey.. I've noticed how some websites have links with no file extensions at the end for example "www.somesite.com/home" and I thought that was done with some kind of other domains (before I read an article about subdomains addon domains and parked domains) and now I am absolutely clueless on how to do this. I'll be glad if someone enlightens me This is using apache mod_rewrite. Whether or not the rules go into a .htaccess file or not, is related to your access to the server. For many people, they don't have access to change their apache config, but rewrite rules can be placed directly in the apache config files for a vhost. Okay I just took some time to educate myself about htaccess and after giving it a shot I realized that it would redirect any non-existing link to mysite.com/new and I don't need that. I only need mysite.com/new to display the file new.php, and like mysite.com/ne wouldn't display anything This is using apache mod_rewrite. Whether or not the rules go into a .htaccess file or not, is related to your access to the server. For many people, they don't have access to change their apache config, but rewrite rules can be placed directly in the apache config files for a vhost, so it's a bit misleading to say that this is done by htaccess. htaccess is just a file that apache can be configured to read which allows you to override default settings for files in that directory -- one of the settings being mod_rewrite rules. mod_rewrite utilizes in most cases regular expression syntax. The Link Zul provided does a pretty good job of laying out a number of different uses. As you can see from that page, mod_rewrite is a toolkit that facilitates SEO friendly url's but can be used to do a number of other things as well. The problem you describe is related to your rewrite rule(s). If you're having problem with a specifc set of rules then you might want to post them and ask for help. Quote Link to comment https://forums.phpfreaks.com/topic/243484-domains-or-not-rly/#findComment-1250344 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.