redirect base url to custom url magento - magento

I want to redirect my baseurl to a custom url(i.e a CMS page basically)
base url : index.php
custom url: home
I followed following steps:
1. Navigate to Catalog > Url Rewrite Management
2. Click the “Add Urlrewrite” button
3. Select “Custom” from the “Create Urlrewrite” drop-down menu
4. The “Urlrewrite Information” form would be completed thusly:
ID Path: index.php
Request Path:index.php
Target Path: home
Redirect: Permanent(301)
Then refreshed cashe. But redirection is not working. "index.php" is still showing same page
Where I am doing wrong?

To create a rewrite for the base url you have to use / instead of index.php

You can try this
Create URL Redirect in admin panel :Marketting->URL Rewrites
Request Path: index.php
target path: ../
it will redirect strong text to the homepage.

Related

Rewrite base url to show content of cms page

Trying to rewrite a base url e.g http://beta.mydomain.com to http://beta.mydomain.com/cms/index.cfm/new-home but want browser to show base url not the cms url.
Im trying this in isapi httpd config file:
RewriteRule ^$ /cms/index.cfm/new-home [NC,L]
but it simply redirects to http://beta.mydomain.com/cms/index.cfm/new-home
which is correct except that the browser must show http://beta.mydomain.com/ not the cms part.
We are using IIS 6 with isapi module installed. Thats the only thing I know about the server (but I have access to server). Is that possible? If not then what other options do I have?
I have an idea: Load http://beta.mydomain.com/cms/index.cfm/new-home in an iFrame.
For example if someone browser to base URL i.e. http://beta.mydomain.com/ then load http://beta.mydomain.com/cms/index.cfm/new-home page in iframe.
It should be like a condition at top of your index page.
if (only baseURL) {
iFrame: Load http://beta.mydomain.com/cms/index.cfm/new-home
}
Hope this help :)

can magento add store with different subdomain?

it's my first time to use magento
my main domain for exmple domain .com with centos OS
my magento on store.domain .com with Ubuntu 16
can i use the same Ubuntu server for another store with sub domain store2.domain .com ?
P.S my main domain domain .com uses wordpress Cms
thanks
Yes. You Can add store with different subdomain. Follow below steps:
Go to admin then select tab System->manage stores
Click create store view and complete the form and save store view
Change the Base URL for each Store view
1.Go to admin then select tab System->configuration
2.On the left side of the page General under that select web but before that you have to change the Current Configuration Scope to your store view name
3.Edit the base url to you subdomain(eg: http://en.yourdomain.com)
4.click save config.
Change .htaccess for redirecting to store view if you call the subdomain
1.Your .htaccess file is at the root folder of magento.
2.Search for "RewriteEngine on" word in .htaccess file and write the code below it
RewriteCond %{HTTP_HOST} ^en.yourdomain.com
RewriteRule ^ - [E=MAGE_RUN_CODE:english]
RewriteCond %{HTTP_HOST} ^fr. yourdomain .com
RewriteRule ^ - [E=MAGE_RUN_CODE:french]
then save the .htaccess file and try to clear all cache and browsing history from your browser as well as from magento.

onepage checkout page is not loading

I had updated a custom theme in magento 1.9 all goes well but when I click on "proceed to checkout" button on cart page (i.e http://mysite/checkout/cart/) it shows link(http://mysite/checkout/onepage/) but always redirects to home page
and If I change the theme to (rwd theme) then this page "link(http://mysite/checkout/onepage/)" runs well
what I am missing in my custom theme that unables the onepage checkout page to load correctly? PLEASE HELP
I checked admin settings >System>Configuration>General>Web
secure base url and other settings all are ok but still I am not able to load to checkout. It still redirects to homepage.
I refer to this link http://www.neiltolbert.com/magento-ssl-checkout-redirect-fix/ for admin settings
If checkout page url is not correct then correct the url for redirection.
Check .htaccess file taht is rewrite mod is ON.
<IfModule mod_rewrite.c>
// rewrite code here
</IfModule mod_rewrite.c>
And check url rewrite code of checkout page if custom rewrite code is available.
And Need to check your add to cart button action , Action url must be redirected to checkout page.

How to change the base link url in magento

I have changed the Base Link Url(base link url) ( not the base url) . Now my site is not accessible except for the home page. How to solve this ? . This option is not visible in core_config_data table too.
I am using magento 1.8.
I changed it system -> web -> unsecured -> base link url .
Now I am not able to access anything in my site. as am getting two index.php in the url.
Go to your root folder and look for .htaccess
In that file scroll down (to line 123) a bit until you find a line of code that is commented out, should be similar to:
RewriteBase /magento/
Change that line to
RewriteBase /

Change URL in address bar but keep on same page

Is it possible to rewrite a url so that the page stays the same and the url itself is chanaged ?
E.G.:
I have a page at www.example.com/sales
I want this url to appear in the address bar as www.example.com/sales_and_repairs
I am NOT trying to redirect a page at www.example.com/sales to ANOTHER page at www.example.com/sales_and_repairs ....There is only ONE page - it is just the URL I am trying to change so that if a person types in www.example.com/sales, they will go to that page but the URL in the Address bar will change to show as www.example.com/sales_and_repairs
Is this possible with rewrite rules ? Anytjhing I have looked up appears to suggest that you have to be redirecting to a second page - but that is not what I want to do - I just want to change the actual URL.
Any advice please ??
If you want to redirect www.example.com/sales_and_repairs to www.example.com/sales permanently you can do it with an .htaccess file.
First of all, you'll have to enable mod_rewrite in apache.
Then add the following to your .htaccess file :
Options +FollowSymlinks
RewriteEngine on
Rewriterule ^http://www\.example\.com/sales_and_repairs$ http://www\.example\.com/sales [R=301,NC,L]
This method allow you to have only one file behind the two urls.
However if you want to modify the url after a user's action, you can do it with the answer given by Sparda above.
Seems you can achieve this with javascript :
location.hash = 'newurl';
But this will add an anchor to the url.
Some earlier features of html5 can do this but are not really supported yet :
history.pushState(data, 'title', 'newurl');

Resources