Register | Login | |||||
Main
| Memberlist
| Active users
| Calendar
| Chat
| Online users Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album |
| |
0 users currently in Programming. |
Acmlm's Board - I3 Archive - Programming - URL redirection | New poll | | |
Add to favorites | Next newer thread | Next older thread |
User | Post | ||
Mercury 0 Since: 11-18-05 Last post: 6470 days Last view: 6470 days |
| ||
I will soon have 1 hosting plan and +3 domain names.
Now I know it's possible to redirect every url to a certain subdomein. I assume like this (in the .htaccess file): RewriteEngine On RewriteCond %{HTTP_HOST} ^www.domain2.ext$ [NC] RewriteRule ^(.*)$ http://subdomain.domain1.ext/$1 [R=307,L] Now my question, when you type the address http://www.domain2.ext, will it change to http://subdomain.domain1.ext in the address bar? Or will you still see http://www.domain2.ext. Or for example if you go to http://www.domain2.ext/folder/file.php, will the url change to http://subdomain.domain1.ext/folder/file.php or will it stay like you typed it first? |
|||
Guy Perfect Since: 11-18-05 Last post: 6303 days Last view: 6301 days |
| ||
Redirections are handled by the web server, not server-side CGI programs. Consult the documentation of your server software to see how to properly handle URL redirections.
Standard HTTP redirections will indeed change the URL. So "www.wikipedia.com" can become "www.wikipedia.org" and so-forth. |
|||
MisterJones Tooky Since: 12-08-05 From: Mexico Last post: 6391 days Last view: 6327 days |
| ||
Originally posted by Guy Perfect All I see there is the use of .htaccess, not any sort of server side cgi program. (edited by MisterJones on 08-31-06 07:32 PM) |
|||
Mercury 0 Since: 11-18-05 Last post: 6470 days Last view: 6470 days |
| ||
Indeed, what I wanted to know was if the url in the address bar in your browser will change to the 'ugly' url or will it stay as how you typed it.
Don't have my hosting now, so can't test it myself. |
|||
Cellar Dweller + Red Koopa Since: 11-18-05 From: Arkansas Last post: 6310 days Last view: 6301 days |
| ||
You may want to look at http://www.modrewrite.com/. In particular, you may and to go to http://forum.modrewrite.com/viewtopic.php?t=1445, and scroll down to the "Mod-Rewrite Directives for URL Redirection" section. It appears your rules will cause the address bar to change.
You could try installing Apache on your computer and test it. But you would need to read the docs to see how to configure it. Also, if you do this, you will need to put your test domains in your hosts file when you do the test. |
|||
Mercury 0 Since: 11-18-05 Last post: 6470 days Last view: 6470 days |
| ||
Thx for the url, I'll check it out! |
Add to favorites | Next newer thread | Next older thread |
Acmlm's Board - I3 Archive - Programming - URL redirection | | |