Questions tagged [url]

Denotes question about URL issues and custom URLs.

Filter by
Sorted by
Tagged with
26
votes
13answers
67k views

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

I am using Magento ver. 1.7.0.2. Here it is the link to my website: http://dev.blokeundees.com.au/ I have to remove the /index.php folder from URLs so I edited the .htaccess file and backend too (...
59
votes
13answers
101k 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?
27
votes
4answers
32k 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 ...
29
votes
5answers
22k 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/ -> ...
18
votes
2answers
18k 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 ...
26
votes
1answer
105k 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? ...
2
votes
2answers
12k 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 ...
1
vote
3answers
21k 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 ...
27
votes
3answers
55k 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.
13
votes
5answers
13k 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 ...
19
votes
4answers
22k 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
771 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
9k 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....
15
votes
4answers
11k views

Magento 2 WYSIWYG Media image directive using admin url

Why is magento 2 creating directives for media images using the admin url? for example when i add an image on category page WYSIWYG it adds <img src="{{media url="wysiwyg/image.jpg"}}" alt="" /&...
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 ...
11
votes
6answers
34k 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-...
6
votes
2answers
12k 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 ...
6
votes
3answers
15k views

Magento 2 get custom module image url from backend

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
378 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 ...
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, ...
4
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
4answers
5k views

How to get product url with category key on home page

I want to get product url with category key in it on home page. for example: www.example.com/category/product.html Thanks
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 ...
1
vote
1answer
689 views

magento 2.2.5 turn back to home when i change store view

i've an issue on magento 2.2.5. I've created two store view it/en, when I'm on product page and change store view from it to en and vice versa, I'm redirected to the home page. Someone can help me? ...
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 ...
18
votes
8answers
27k 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?
15
votes
3answers
14k 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/...
8
votes
2answers
34k 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
36k 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
62k 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(); ...
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
24k 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
16k 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.
3
votes
3answers
3k 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....
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
5k 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 ...
4
votes
1answer
338 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'...
4
votes
1answer
3k views

Magento 2: Create a Page with Dynamic URL with Same Controller

I posted a question earlier but didn't able to understand the answer, Magento 2: How to create a dynamic url with the same controller i want to create a page with the dynamic url but with same ...
3
votes
1answer
1k 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
6answers
14k views

Magento 2 is generating the product url with catalog/product/view/id instead of product name

We are having a strange problem in our Magento 2 webshop. Our webshop has different ways of generating the product url. So some of our products just show the product url as it should be /name-of-the-...
3
votes
2answers
8k 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
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 ...