Jump to content

Domains or not rly


manix

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/243484-domains-or-not-rly/
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/243484-domains-or-not-rly/#findComment-1250229
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/243484-domains-or-not-rly/#findComment-1250344
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.