Joomla 2.5 - Adapting Custom URLs with .htaccess or tool - .htaccess

i've just finished a website with a database for golf-holidays. Now the clue is, i am using joomla internal url-rewrite to generate short urls which is generally great, i like it. The only thing left for SEO optimization would be, if i could point an individual URL to each offer listed in the database. A url to a specific offer looks like this :
http://www.mydomain.com/golfurlaub-mit-greenfee/angebote/urlaubsangebot.html?oid=128
"urlaubsangebot.html" would be the detail site, passed with the parameter "oid" for offerID and then the ID of the offer in my database.
Would it be possible to create a rule / use a tool where i would be agle to assign a custom URL to every offer? For example :
NewURL
http://www.mydomain.com/offers/spain/my-offer-name.html
OldURL
http://www.mydomain.com/golfurlaub-mit-greenfee/angebote/urlaubsangebot.html?oid=128
I tried using tools such as SEF404 and JoomSEF but they rather break my whole structure than help me apply these urls. Any ideas?

Joomla 1.6+ is shipped with Redirect Manager (Components > Redirect). It's designed exactly for this purpose (redirecting old urls to new ones).
Joomla 1.6 will include a new component and plugin called Redirect.
Its main function is to provide a mechanism to record 404 "not found"
errors, and to give the Web site owner the ability to redirect those
to another page if desired.
If there are links to your site that result in error 404, these should be already populated in the list when you open the manager - you just have to add new urls to which to redirect to.
References:
A preview of link redirection in Joomla 1.6

You can use the .htaccess rewrite rules for that:
RewriteEngine On
RewriteRule ^(offers/spain/my-offer-name.html)$ index.php?option=com_mycomponent&oid=128 [L]

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 to make SEO friendly URL using .htaccess

I want to make this URL
https://www.maxelplus.com/single-commercial.php?PId=Mjc&Title=Domestic%20Products
to
https://www.maxelplus.com/domestic-products/table-top-wet-grinders/sleek-table-top-wet-grinder-2l-LEP883/
I used below code but is not working.
RewriteRule ^domestic-products/table-top-wet-grinders/sleek-table-top-wet-grinder-2l-LEP883/$ single-commercial.php?PId=$1&title=$2 [QSA]
Please share whate i am missing..
Depending on how your website is being hosted, it might be helpful to look at the .htaccess permalink structure which can be found here.
It looks like your first link is using a custom structure permalink, but your desired URL is a combination between post name and product number. A generic set of instructions can be found here if you are using WordPress. This can also clarify the benefits of using URLs that are friendly for Search Engine Optimization (SEO).

301 redirect all ugly permalinks from old site to new site

So I overhauled a complete website the other day and found some of the old pages snippets in the google search results. The old page had an ugly link structure such as domain.com/index.php?article_id=123. The new site uses pretty permalinks such as domain.com/pagetitle.
Is there a piece of code I could put into the .htaccess file in order to redirect all ugly permalinks to the new site?
Edit
Additional info: The old links don't exist anymore. The old site and the new one's structure differs a lot, not all contents from the all site were adapted. Main problem is that I don't want the old links in the google search results to always throw a 404 at the user.
Maybe something of a
RedirectMatch ^/index.php?$ http://www.example.com/somepage
This will redirect all pages starting from index.php to another location
I don't have the rep to comment on the other answer, but that is a very improper solution if you value your SEO at all. A redirect is your way of telling Google "I've got the same page, I just moved it". There's a much better way to do this that won't negatively affect your SEO at all.
You should create some logic to redirect those old links to your new links.
Here's an example of how you could do it:
Go to the beginning of your program, before any logic takes place.
Use code to retrieve the requested page. In this case, you might be able to get away with simply checking for GET variables that match article_id.
If the requested page is a match for your GET variable, run a query to see if the article exists. (Obviously, you'll still want to 404 articles that don't exist).
Retrieve the content used to generate the new, more SEO-friendly URL's. This is probably the article title or something.
Write some code to generate the new article title. At this point, if this is working properly, you should be able to system print that new URL to make sure it's correct.
301 redirect to the new URL. Don't 302 or any other number, 301 redirect it. This lets search engines know it's the same page and content, but it has permanently moved.

Url duplication with Prestashop SEO

I have an e-commerce developed with the CMS Prestashop.
Yesterday i have seen in my Webmaster Tools that i had some duplicated URL, like this:
www.mysite.com/manufacturers
www.mysite.com/it/manufacturers.
Where 'it' is the suffix of the default and only language for the website.
I've already activate the friendly URL in the back-office and also I've a .htaccess file generated automatically by the generator in the back-office.
What should I do to fix this issue?
PS: Also I think that I've already taken a penalization from googlebot.
First of all let me clarify the Title from the SEO point of view. The problem is from Prestashop side not from SEO side. It is just affecting your SEO.
Now on the problem, Prestashop is notorious for URL problems. I would not recommend you the .htaccess hack solution because every time you regenerate your .htaccess from you backend, you have to manually insert that hack again in it to keep the problem down. And suppose this url problem arises again after sometime for some other url than you have to do it again. It can turn into a nightmare.
So here are some of my personal recommendations...
If this site is critical(which I am assuming), buy a Prestashop url rewriting module from a trusted provider. You will also get a technical support in case this problem arises again in future.
If you can't buy than I would suggest you to ask this question on Prestashop forums, as this is Prestashop specific, to permanently solve this problem. You will most likely to get more instant answers as you will find more people working on Prestashop there than here.
Somewhere either in the htaccess file in your document root, or in the vhost/server config for mysite.com, you'll need to 301 redirect. Now you just need to choose which one you want to keep, the one with /it/ in front or the one without? Let's say you want to point everything to the one without, you'll use one of these:
Using mod_alias:
Redirect 301 /it/manufacturers /manufacturers
Using mod_rewrite:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?mysite.com$ [NC]
RewriteRule ^/?it/manufacturers(.*)$ /manufacturers$1 [L,R=301]

Symbol "?" in alias or Dirty url

I want to move the website to the Drupal CMS with original paths. It's look like
website.com/search.php?q=blablabla
website.com/index.php?q=blablabla
website.com/category.php?q=auto&page=2
etc
How can i use these aliases in Drupal? Thank you.
I think you will have great difficulty setting this up, if it's even possible. It would be much better to let Drupal use its standard clean URLs and to setup URL rewrite rules to translate requests for legacy URLs to the new ones.
For example, Drupal's search URL looks like:
website.com/search/node/blahblah
And in .htaccess you could define:
RewriteRule ^search.php\?q=(.*)$ /search/node/$1 [R=301,NC,L]
Which would match the format of your legacy search URL, extract the query and rewrite the URL so that query is in Drupal's clean form. That way requests to website.com/search.php?q=blah get translated to website.com/search/node/blah before getting sent to Drupal. The user however will see the new, Drupal-style URL.
mod_rewrite is well documented.
This is of course going to be harder to do if your legacy URLs make use of unique IDs that do not exist in Drupal. In that case I'd take care to make sure that node IDs and taxonomy IDs etc all correspond between your legacy site and your new site. That way you could translate something like /view.php?articleID=121 to /node/121.
This has the effect of handling any incoming links from search engines, third party sites, or users' bookmarks, but leaves you with an entirely new URL structure. I've used this approach before when migrating to Drupal.

Resources