Magento .htaccess Removal of index.php from Store Urls - .htaccess

I do not want my URLs on my Store to contain index.php. All my product pages can be accessed via addition of index.php and without it which is not good and I want to get rid of index.php from the urls.
For example, both of these urls display the same content, but I only want users to ever be directed to the second URL:
http://www.pudu.com.au/index.php/outback-mens-denim-cargo-shorts.html
&
http://www.pudu.com.au/outback-mens-denim-cargo-shorts.html
Likewise for content at the top level of the site:
http://www.pudu.com.au/index.php
&
http://www.pudu.com.au/

Magento adds the system endpoint (index.php) to the URL path based on a configuration setting. In the admin, navigate to System > Configuration. In the Web section, open the Search Engines Optimization group and set Use Web Server Rewrites to "Yes". You'll need to flush the configuration cache and redindex URL rewrites thereafter.

Related

redirect numerous dynamic urls to home page via .htaccess

I am trying to clean up a previously hacked WordPress site, and domain name reputation, the site has new hosting and is now on a different CMS system, but there are hundreds of spam links in Google I need to get rid of, they look like example.com/votes.php?10054nzwzm75042pw205039
Domain name, then votes.php?**** etc.. Numbers letters all sorts.
So how do I redirect ANYTHING that starts with the domain name then /votes.php?***
Any help greatly appreciated
Unless you have multiple domains, you don't need to explicitly check the domain name.
To send a "410 Gone" for anything that contains /votes.php in the URL-path (and any query string), you can do something like the following at the top of your root .htaccess file using mod_rewrite:
RewriteEngine On
# Serve a 410 Gone for any requests to "/votes.php"
RewriteRule ^votes\.php$ - [G]
A 410 is preferable to a "redirect" if you want to get these URLs removed from the search engines as quickly as possible.
To expedite the process of URL removal from Google then use Google's Removal Tool as well.
If you redirect these pages to the homepage then it will likely be seen as a soft-404 by Google and these URLs are likely to remain in the search results for a lot longer.

How do I rewrite old URLs without affecting default redirects?

Let me see if I can explain this.
I used to have mydomain.com as my default page. The login page would be mydomain.com/login and every content created would become mydomain.com/topic1, mydomain.com/topic2 etc.
But I have created a subdirectory, so it's now mydomain.com/sub/login and mydomain.com/sub/topic1 etc.
I then set mydomain.com to redirect to mydomain.com/sub/login via my host's panel (Hostinger).
If a user accesses the website from one of the old links, I would like it to change the URL to include the new subdirectory automatically, without affecting the redirect I have created.
How can I do so? Is it possible?
Thanks, folks!

How to remove default code from url in magento

In my Magento I've created two store so we have now these stores:-
commercial and url :- www.mysite.com/commercial
default and url www.mysite.com/deault
retail. and url www.mysite.com/deault/retail
My commercial url looking good but I want to remove default from these stores :-
deault and url www.mysite.com/deault
and
retail. and url www.mysite.com/deault/retail
If I disable :"Add Store Codes" to Url = no then commercial stores stops working.
Here's an explanation for how to do it:
http://www.crucialwebhost.com/kb/how-to-setup-multiple-magento-stores/#subdirectory-method
Basically you need to manually create the subdirectories and put modified copies of the files index.php and .htaccess inside.
But this assumes that you run the 'default' shop directly on the domain top level directory. Another Stackoverflow post that could give insight into the settings:
Multiple magento stores on single domain

Redirect based on query string?

I am trying to update the .htaccess file to redirect web users from pages on older version of our site to our current site.
The old PHP files have no direct relationship to file names and extensions used on our current site.
For example:
www.mydomain.com/pages/site/properties/properties.php?id=Smith
To:
http://mydomain.com/properties/sally-smith/
Or:
www.mydomain.com/pages/site/properties/properties.php?id=Jones
To:
http://mydomain.com/properties/robert-jones/
My site has several more pages with same path but with different PHP id's. I am getting stumped on how to handle each individual id in writing a 301 redirect from old pages to their corresponding current pages.

Magento - Multi Website Setup

I am having configuration settings with my multi website magento setup.
I have a website running at abc.com . Now for international storefront I have created another website, store view and store with abc_international as the website code.
In my configuration, I have configured Base URL as abc.com/int/
However, when I access the URL abc.com/int/ it generates a 404 error.
Another important point is even if I specifically make changes in index.php as follows -
$mageRunCode = "abc_international";
$mageRunType = "website";
Mage::run($mageRunCode, $mageRunType);
Any ideas as to what might be the problem.
You need to copy index.php and .htaccess files to abc.com/int/ at server and provide particular path to Mage.php file at index.php which is inside abc.com/int/ and in that index.php file you need to modify Mage::run($mageRunCode, $mageRunType); to Mage::run("abc_international", "website"); then it will work if you properly configured multi-website setup.

Resources