Set up URL redirect for a localhost site - xampp

I've developed a small site for an academic project, and I'd like to have it being shown as a live site, with its own domain name.
For example: I want to enter the domain name JustAnExample.com, but it should access the localhost.
I've tried to change the Hosts file, but it didn't work.

Changing the Hosts file should work!
adding > 127.0.0.1 justanexample.com <
will redirect it to localhost.
this may help! Editing local host file

Related

Need help in pointing application in the default website to have a domain name

How to add an IP address to the virtual directory in IIS, for example i have pointed the domain name to the default website and it is pointing correctly, the issue i would to have a domain for the defaulvirtualdirectory/application(ex:www.xyz.com/abc) to have a domain name http://abc.def.com.
I tried all the possibilities like HTTP redirect but the problem is it is pointing to the default website instead of application.
If you want to have website URL like http://abc.def.com to load web-contents of sub-directory e.g WWWROOT/application, you should add another subdomain website http://abc.def.com with documentroot as WWWROOT/application. The primary website(http://def.com) will load web-contents of WWWROOT and subdomain website(http://abc.def.com) will load webcontents of WWWROOT/application directory. You can also point subdomain website to different IP address if you want.

How to correct the url in magento of website and admin panel?

I am doing a project in Magento. I have uploaded my work onto a live server. I have updated the core_config_data table with the server urls in the secure and unsecure urls. But when I typing the live server link, its going to the local server url and also when I am accessing the live servers admin panel its going to the local server url. Can anyone tell why it is like that ?
After changing website from local to live you need to do following changes:
change url's from core_config_data table
change database details from local.xml
and most important, Redirect problem was due to Magento cache.
Simply delete everything from the /var folder.
After performing the above changes, clear your browser's cache & cookies and check again.
On your computer, check your hosts file and see if you have an entry for your domain.
On windows: C:/Windows/System32/drivers/etc/hosts
On mac or ubuntu: /etc/hosts
If you see an entry that shows:
127.0.0.1 www.mydomain.com or
localhost www.mydomain.com
then you should remove your entry.
You should also flush the dns cache.
Whenever I work locally, I use the subdomain 'local' like local.mydomain.com and this way I dont have to worry about these issues.
Also, you should fully delete the var folder, it is safe to do so.

codeigniter accessing through IP address in subfolder

I have a backoffice module in codeigniter. ive uploaded it to a.setver.into backoffice/ folder. the server can be accessed only by IP address like http:// IP ADDRESS /~user/backoffice/ but its not working.
ive uploaded it onto another server which can be accesses like www.domainname.com/backoffice/ and it works fine there.
i have to make it work on the first server without editing the hosts file.
i guess there must be a problem with segments order in the urls.
I opened the error log which sais file not found usr/local/apache/htdocs/home .
the home is the default controller.
the config bse url is set fine.

How to migrate a Magento Installation to localhost

I've been following several guides over the internet, but I still can't access my Magento (1.6) website from localhost ..
I dumped the DB and imported it to phpMyAdmin, copied the files from the server to my localhost (WAMP), updated local.xml and have been to the core_config_data table and changed web/unsecure/base_url to new URL & web/secure/base_url to new URL.
Is there anything else to do ?
I've seen that sometimes, in some guides, they're asking to go to C:\windows\system32\drivers\etc\hosts and insert the following lines: 127.0.0.1 www.mydomain.com mydomain.com
But I already did this to www.localhost.com since I already have several websites I need to run from localhost, I don't want to change that ..
So when I launch the website from www.localhost.com/mywebsite I'm redirected to the old address and my browser says "Oops! Google Chrome could not find 'the old address' "
Any suggestion would be welcome :)
As long as core_config_data.path values are updated correctly (double-check), the only other thing (besides Magento's PHP code) that could do a redirect is an .htaccess file with a RewriteCond and RewriteRule directive. This also could be present in the VirtualHost.
As another option, you could edit the Windows Hosts file, and resolve your old domain name to 127.0.0.1 and update your VirtualHost's ServerAlias line to include that domain name.
Maybe check that web/cookie/cookie_path and web/cookie/cookie_domain are correctly set into the core_config_data table. I usually delete values of these 2 fields when switching from a server to another.
Also always think of disabling cache before dumping your DB as this can avoid some struggling too.

Hosts file Redirect website to about:blank

I was just curious, how do I redirect a webaddress to a blank page using the windows Hosts file? All I know now is this 127.0.0.1 googleads.g.doubleclick.net. So how do I redirect the address to a Blank page?
thanks
You can't.
The HOSTS file assists in name resolution—converting a hostname to an IP address.
about:blank is a special URI that has nothing to do with name resolution.
You could run a webserver that sends 301 redirects to about:blank (or just sends blank pages), then add that server's IP address to the HOSTS file.

Resources