Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [url]

Denotes question about URL issues and custom URLs.

26
votes
12answers
65k views

Remove /index.php from the Magento URL gives 404 error

I am using Magento ver. 1.7.0.2. Here is the link of my website: http://dev.blokeundees.com.au/ I have to remove /index.php from the URL so I have changed into the .htaccess file and backend (secure,...
29
votes
5answers
21k views

Different storeviews or websites in subfolders

A client wants his multistore shop to be set up like this: http://www.domain1.org/de/ -> website 1, store view 1 http://www.domain1.org/en/ -> website 1, store view 2 http://www.domain1.ch/de/ -> ...
27
votes
4answers
31k views

Efficient get product url from id

What is the most efficient way of getting a product url given just it's ID? In a few places in our code we have things such as Mage::getModel('catalog/product')->load($id)->getProductUrl() in ...
54
votes
13answers
82k views

How to get Magento 2 base URL?

In Magento 1 Mage::getBaseUrl();, but in Magento 2 I have to pass responsible class object type in constructor. I don’t have the idea which class I have to pass?
18
votes
2answers
15k views

Magento 2: Product URL Suffix

How do I remove the .html suffix from the product pages?
6
votes
2answers
9k views

Redirect 'non www prefix to 'www' prefix still not working after disabling 'Auto-redirect to Base URL'

Magento install was redirecting all 'non-www' urls to the root home page. I found these questions on the same subject: Redirected to the Homepage when add www. in any URL Redirected to the Homepage ...
10
votes
3answers
13k views

why magento product url duplicating

I am using magento 1.7. i am faceing strange problem. magento making duplicate product url with random number with wrong url key please my attached screenshot I also empty table rewrite_urls and ...
1
vote
3answers
20k views

Magento get store url in cms page

I want to get the store URL in cms page when I tried this {{store url='abc/efg/xxx/yyyy'}} It does not return the given URL. Its give output like this http://domain.com but I need to get like ...
9
votes
7answers
6k views

Website start redirecting to another url

Maybe it's infected by some virus. My website starts redirecting to these infected URL. http://mon.setsu.xyz and some time https://tiphainemollard.us/index/?1371499155545 Infected links what I did ...
26
votes
3answers
52k views

Correct way to change the magento 1.9 admin url

Correct way to change the Magento 1.9 admin url anyone can provide me the correct way. I see a lot of different suggestion online.
25
votes
1answer
101k views

Mage::getBaseUrl() vs Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB)

Is there a reason to use Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) rather than Mage::getBaseUrl()? I've seen both in use, and they both return the same thing. Is the longer one redundant? ...
13
votes
5answers
12k views

404 on Store Switch with Product Store View Scoped URL Key

By default URL Key on product page is Global scoped. EDIT: As suggested by FlorinelChis the scope can be changes in Manage attributes. However this breaks the store view switcher behavior. This is ...
2
votes
2answers
11k views

I want to use ADD TO CART via URL in Magento 1.8 but don't know which files to change

I have seen some suggested changes to make to call the FORM KEY to allow the ADD TO CART FROM URL to work. <?php $formKey = Mage::getSingleton('core/session')->getFormKey();?> <form ...
3
votes
3answers
2k views

How to remove parent category from subcategory URL?

I want to remove the parent category from the subcategory URL. For example, I would like to change: www.magento2.com/Category1/Category2/gear/bags.html to www.magento2.com/bags....
17
votes
4answers
18k views

How to remove SID (session ID) from URL in Magento 2

How to remove the session ID from the URL in Magento 2 (frontend). This is the SID query parameter in the URL. For example: https://example.com/contact/?SID=sfl317buq8ru4uf4a...
1
vote
1answer
603 views

Website switching in magento 1.9 without changing the default url

I have a website in Magento 1.9 called www.example.com. In Magento, we know that we can create multiple websites so I have created like that multiple websites with their own store and store view. so I ...
0
votes
1answer
3k views

Static product page URL with category

I'm looking for solution of how to make the product always have a static URL with category name, no matter from what category I entered. I want URL to always look like this: http://example.com/...
2
votes
2answers
8k views

Cannot display image inserted by WYSIWYG editor

I created a form on backend and inserted an image into the editor. The image displays properly in the editor. However, the image cannot be displayed on frontend and 404 error is shown on the console. ...
7
votes
2answers
12k views

Magento url key has strange numbers added by the system Magento 1.7.0.2

I've been pulling my hairs to figure out what's going on with my Magento store (1.7.0.2 version). 80% url-keys are appended with strange numbers in two different forms. Some are like this http://www....
5
votes
2answers
8k views

Include categories in product URL

I have a product object and I need to get product URL of it that will include all its categories e.g. - http://example.com/category/subcategory/product_name I've managed to find a way that will ...
6
votes
2answers
11k views

Internal links to end with a trailing slash

The links in the main navigation end without a trailing slash, which do not match the canonical tags which end without. Is there an easy way to make all links throughout the site end with a trailing ...
5
votes
2answers
12k views

Magento 2: Get image url

I used <?php echo $this->getViewFileUrl('Vendor_Module::images/demo.jpg'); ?> <?php echo $block->getViewFileUrl('Vendor_Module::images/demo.jpg'); ?> But it's working only ...
2
votes
1answer
4k views

jQuery ajax data to controller

I am trying to make my first ajax request in magento to controller file but can not get it working. My .js file is: jQuery.ajax({ type: 'post', url: 'vendor_module/index/...
0
votes
1answer
365 views

URL's creating Duplicate Content best practices?

I am using the Community Edition and recently started working on Magento on a site that has been live for 3.5 years. I noticed that in Google Analytics, I am getting 2 different results on the CMS ...
3
votes
3answers
5k views

Magento multistore, __store and ___from_store in URL

we are setting up a multistore. Now we see "__store and ___from_store" in the UR. Is there an easy (and accepted method) of utilizing the functionality, but hiding the url string "__store and ...
2
votes
1answer
4k views

get product seo url from id [duplicate]

i want to get product seo url from id below is code i used to get url from id $my_product = Mage::getModel('catalog/product')->load($id); $my_product_url = $my_product->getProductUrl(); but ...
0
votes
3answers
4k views

Mass change product URL keys to match product names

Shopkeeper created configurable products by duplicating existing products and did not change the product URLs to match the product names. The shop is also a multilingual shop and different languages ...
15
votes
3answers
12k views

Magento 2 : get rewrite product url

I am trying to get rewrite product url from the load product in custom module. I am getting url in http://localhost/m2/catalog/product/view/id/1401/category/23/ format . But I want http://localhost/...
7
votes
2answers
32k views

Why do we have to use “store” for links in CMS like <a href=“{{store url='home'}}”>home</a>

To insert links in the CMS, we use this code: <a href="{{store url='home'}}">home</a> What is this "store" keyword doing and why is it called "store"? And are there any other keywords ...
16
votes
3answers
35k views

add query parameters to an existing url string

In Magento if I have a URL string, is there any built in function that I can use to add query parameters to it? In the exact case I am looking at I am generating a category URL and then I want to add ...
15
votes
2answers
58k views

$_product->getProductUrl() giving url path without URL key

I am getting a product collection of a certain category on a page in a few different Magento sites. My code for getting the collection is: $category = new Mage_Catalog_Model_Category(); ...
14
votes
8answers
21k views

How to change magento2 admin url?

Once the installation is completed, is there a posibility to change admin url? If yes how can I do that?
9
votes
3answers
8k views

Using Secure URLs based on context

I am familiar with using various methods to generate a secure URL based on context, ie: $this->getUrl('my-page', array('_forced_secure' => $this->getRequest()->isSecure())); This works ...
8
votes
2answers
4k views

Get URL of the static content folder (for backend)

Inside a block class which is being used to render a button in the admin panel, how to get the URL of the static content folder? Specifically, URL of the folder with images? For example, in ...
7
votes
3answers
23k views

How do i call a controller function in ajax?

This is the content of my .../template/exportdb/attributes.phtml file: <span id = "attributes">Generate</span> <script type="text/javascript"> jQuery(function () { ...
5
votes
3answers
15k views

How to get Admin page url?

I want to get the current url of an admin panel page. I tried the folowing. $currentUrl = Mage::helper('adminhtml')->getUrl(); But it's not returning the current url.
8
votes
2answers
8k views

Get product path from id with category path in url [duplicate]

i want to get product url from id with category path in url : for same product url are like : http://websitename/rings/diamond/blue-diamond.html http://websitename/blue-diamond.html with my code ...
8
votes
3answers
4k views

How to get product's frontend url from backend?

I am developing a extension of Magento 2. I need to get a product's frontend url from backend. I have tried to use: //$storeManager->->setCurrentStore(2); $url = $product->setStoreId(2)->...
6
votes
2answers
6k views

What information is required in the ID path of a Magento URL Rewrite

Is it required to use the old URL in ID path? I thought that was just used for personal identification and you can fill in whatever you want?
4
votes
3answers
8k views

Redirected to the Homepage when removed www. from URL

Say, My Website is : www.example.com I have one page : www.example.com/contactus If I remove "www." from above url, means : example.com/contactus It redirects me to the homepage. Why ?? Checkout ...
3
votes
1answer
849 views

Magento 2 - Set global variable

I want to know if it's possible to add a global variable all through the site (so that if I need to change it, I would only need to do it once). It's for an URL.
3
votes
1answer
321 views

What's the purpose of the unique index on 'value' in 'catalog_product_entity_url_key'?

We're on a heavily modified EE 1.13.0.2 with some 20 store views - some of them sharing the same language - facing a problem with url keys. These are generated and differ per language BUT this doesn'...
2
votes
2answers
6k views

How to get RefererUrl in magento 2 observer?

How to get RefererUrl (source page url) in Observer file? Actually by using this; $this->_redirect->getRefererUrl(); I am getting Referer Url in magento 2 controller file.But in Observer file ...
2
votes
2answers
8k views

How to add a product to the cart using a URL or query string?

I'm using Magento Enterprise 1.13; there appears to be some documentation around for adding a product using the URL & query string but those do not appear to be working for me. For example: Add ...
2
votes
3answers
3k views

Magento duplicate meta tags in google webmaster

I have magento 1.7. For seo reasons I am getting Duplicate meta descriptions Tags problem from google. For example /paralympics-paralympische-spelen/ /paralympics-paralympische-spelen (with and ...
0
votes
1answer
207 views

Customer account section on subdomain

I have a single website, single store view Magento installation on, lets say, the domain example.com. Now I want to create a customer section "My Example.com" on my.example.com. So the whole customer ...
0
votes
1answer
323 views

Magento 1 Rewrite Pagination url Parameter

for sure this question has been asked so many times in different ways, but i didn't find anything usefull for my case. We have an installation of Magento 1.9.3.6, the main task is to rewrite the ...
8
votes
2answers
6k views

In magento admin url, the word “admin” occurs twice. how to remove the second one?

I have a situation where my client's admin url is something like this; http://www.example.com/index.php/admin/admin/dashboard/index/key/0981a6bd2f5a06fec85d3c9e297849a0/ the word admin occurs twice, ...
8
votes
5answers
27k views

Magento2 - Get category URL by ID

I'm trying to get the URL key of any given category with the ID. I have this; $categoryId = 3; $_objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $object_manager = $_objectManager-...
8
votes
4answers
3k views

Always show full URL including categories for product

For our Magento webshop (1.7.0.2), we're trying to optimize the URL structure. We've already managed to improve some things, but in one things we didn't succeed. We want to use a full URL (including ...