Questions tagged [url]
Denotes question about URL issues and custom URLs.
91
questions
26
votes
13
answers
74k
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 (...
68
votes
13
answers
173k
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
4
answers
34k
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 ...
30
votes
5
answers
24k
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/ -> ...
21
votes
2
answers
25k
views
Magento 2: Product URL Suffix
How do I remove the .html suffix from the product pages?
27
votes
5
answers
54k
views
Get Current URL from a PHTML - Magento 2
I'm struggling trying to show the current URL from a PHTML in Magento 2.
Any suggestion?
16
votes
7
answers
69k
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
2
answers
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
3
answers
14k
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 ...
2
votes
2
answers
13k
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
3
answers
22k
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 ...
27
votes
3
answers
61k
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.
27
votes
1
answer
111k
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? ...
19
votes
5
answers
30k
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...
Removed starting ...
13
votes
5
answers
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 ...
9
votes
7
answers
8k
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 ...
8
votes
3
answers
8k
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)->...
4
votes
4
answers
11k
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
2
answers
10k
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. ...
1
vote
1
answer
988
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
1
answer
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/...
24
votes
8
answers
44k
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?
16
votes
4
answers
17k
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="" /&...
8
votes
2
answers
9k
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
3
answers
24k
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 ...
7
votes
2
answers
13k
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....
6
votes
2
answers
13k
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
2
answers
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 ...
4
votes
3
answers
6k
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
1
answer
5k
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/...
2
votes
1
answer
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
1
answer
457
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 ...
0
votes
3
answers
5k
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 ...
16
votes
3
answers
40k
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 ...
16
votes
3
answers
18k
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/...
16
votes
2
answers
71k
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();
...
12
votes
5
answers
13k
views
Magento 2: Remove Store Code in URL only for default store
We run a magento 2 multistore in 2 langauges where default store view is german. Online shop is also available in french. Store code is added to URLs like the following:
www.domain.at
www.domain.at/...
9
votes
2
answers
39k
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 ...
9
votes
2
answers
7k
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
4
answers
4k
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 ...
8
votes
2
answers
6k
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 ...
8
votes
2
answers
20k
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 ...
7
votes
2
answers
7k
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?
7
votes
3
answers
27k
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 () {
...
7
votes
2
answers
3k
views
Best way to check if page is home page
What is the most reliable way to check if current page is the home page? I need to check that in a block class and in a helper class. Searching on forums, I've found two popular ways to do this:
...
6
votes
2
answers
4k
views
Change Magento URL category Rules
I'm trying to modify URL-Category Rules, from Category Hierarchy-Oriented rules to Seo-Oriented rules.
So i need to change URLs in this way.
From:
- Root-Category (URL: /rootcategory.html )
-- ...
6
votes
2
answers
9k
views
Setting AJAX URL for custom module
I have a JavaScript file in /js/mds/mds_collivery.js. In it I have an AJAX call that should go to magento_install_url/collivery/ajax/cptypes. It will only be used in /checkout/onepage/.
However, if I ...
5
votes
1
answer
4k
views
Magento : How to hide the default Store View code from the url
The site has 2 languages: English and French, represented by 2 store views. French is the default one. For our SEO efforts we need to have the following urls:
French - http://www.domain.com/category/...
5
votes
3
answers
18k
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.
5
votes
1
answer
5k
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 ...