Redirection in magento - magento

I am working on custom module. I try to redirect my module to magento catalog category page. The link for the page is
http://localhost/project/index.php/admin/catalog_category/index/key/cc65595b0383ca64fb245cb7de2359d8/
I have tried following methods without success.
$this->_redirect($this->getUrl("admin/catalog_category/"));
$this->_redirect("admin/catalog_category/");
Magento is removing admin from url ? final url look like that
http://localhost/project/index.php//catalog_category/index/key/cc65595b0383ca64fb245cb7de2359d8/
I didn't figure out why admin is skipping from my url ? can anyone help ?

Try below code.
$this->_redirect("adminhtml/catalog_category");
The first URI(ie adminhtml) is module name and for admin area the module name is adminhtml.

Related

URL page not found error

I have a webshop with magento wherein :
abc.com/staff is giving page not found error
abc.com/staff/ is loading the page correctly.
There is a difference of "/" in both the URLS. I have other CMS pages in magento such as contact-us which are working perfectly fine. Need assistance in this scenario about what is going wrong.
You have entered page url while creating that cms page as staff/ so replace this page url to staff.
Maybe you have a specific rule for url staff anywhere (ie: in .htaccess file) or a directory staff in Magento root folder or an older rewrite rule in database.

Wrong url in magento paging

I have a problem regarding paging of the custom module. When i click on the next page the it take the url as localhost/magento/fme-support/index/index/url/BC/?p=1, but this url doesn't work properly, the correct URL is localhost/magento/fme-support/category/BC/?p=1.
Please suggest me how and i change this url.
Thanks.
Try making url rewrites off
If it doesn't work there is some issue with your extension you have installed
Check for redirect in your extension
The "index" in the URL means you are calling the index controller of the module.
Magento module URLs work like this
http://magento_installation.com/(storeview)/moduleMame/controllerName/functionName/

Is there a way to change login page URL in Magento?

I want to change the URL for customer login in Magento.
From the URL,
www.mydomain.com/customer/account/login/
To something like this:
www.mydomain.com/login
How can I do this?
I have not tried this method yet but you can achieve this with url rewrite.
Go to url rewrite and add custom url rewrite, give unique id path.
And in request path give www.mydomain.com/login this url and in target path give this url www.mydomain.com/customer/account/login/ magento internally consider target path for its use.
For more Info on url rewrite you can see here http://www.magentocommerce.com/wiki/modules_reference/english/mage_adminhtml/urlrewrite/index
http://blog.beetleweb.com/2012/10/creating-custom-magento-url-rewrites/
1)Login to magento admin panel
2)Goto catalog->URL Rewrite Management
3)In Requestpath give www.mydomain.com/login
4)In Targetpath give www.mydomain.com/customer/account/login/

magento admin url redirect to home page automatically

I faced a strang problem: When I want to login admin page, but it automatically redirect to home page.
our shop url is www.bestinnature.ca, the admin page is www.bestinnature.ca/index.php/admin.
could some give me some advice?
Play with site.com/magento/custom_admin_name to site.com/magento/index.php/custom_admin_name
You need to make changes in the core_config_data table in your database.
Regards
Vikk

Magento not using appropriate URL - 404 Page not found

I have a magento site running locally using WAMP and it works great. However I need to create a different site so I created a folder for this new site under htdocs.
In that folder I loaded the Magento files.
Created a new database for newsite with all rights in phpmyadmin.
Went to the localhost:8888/newsite and started Magento installation wizard.
In the configuration section of the wizard I entered all the info required: db name, user, password. For URL Base I used the default (http://localhost:8888/newsite). Selected allow charts and Allow apache rewrites. Finished installing magento.
Now magento is running on newsite. I can see the front and back-end of the site.
Here is the problem: When I create a category and/or subcategory, magento does create the menu link but when I click any category, the browser takes me to a 404 not found. Upon analyzing the URL that took me there i see that the URL is : http://localhost:8888/newsite/category.html BUT by adding "index.php" into the URL (http://localhost:8888/newsite/index.php/category.html , the page does work!
So this means magento IS creating the page for the category but the linking is somewhat wrong.
Now, I've been making sure that rewrite is enabled and after all, the other site I mentioned I have is working properly, so I assume rewrite is properly enabled.
So I need help finding:
Why is one site working and the other isn't?
How can I fix this issue?
Thank you!
Sounds like you haven't copied over the .htaccess file (in your Magento root folder). You need this file for the Apache rewrites to work.

Resources