Search code examples
.htaccessurljoomla

Joomla URL generated


I have problem with duplicate content in my blog. All my URL are like this

https://www.dbigcloud.com/cloud-computing/170-openstack-desde-cero-keystone.html

I don't know why all URLs work with

https://www.dbigcloud.com/~dbigclou/cloud-computing/170-openstack-desde-cero-keystone.html

Could I redirect all content with ~dbigclou to the normal url in .htaccess ? I don't know how to create the rule for the char ~

I try with

RewriteRule ^~dbigclou/(.*)$ /$1 [L,NC,R]

but it doesn't work.

EDIT:

I've been investigating and it happens when I add any word before my category

https://www.dbigcloud.com if I add

/sdasdasd/asdasdasdasd/asdasdasdas/cloud-computing/170-openstack-desde-cero-keystone.html

it works

so I think it's a problem of my joomla (3.7) I create a new .htaccess from htaccess.txt

Anybody can know what it happen?


Solution

  • Here are some ways to fix:

    1. Check for Hard-coded links Check your database to see if you put the /~username/ in your actual links. The quickest way if you are comfortable is to go to phpMyAdmin, select your database and use the SEARCH tab. This is fastest because it checks all tables at once. If you don't want to touch that, try NoNumbers DB Replacer and check the content table (introtext and fulltext), modules (content), and menu tables (link) for ~username.

    2. RewriteBase in .htaccess Check your .htaccess file (via FTP in root folder) to see if you have it has it in the RewriteBase. It would look something like: RewriteBase /~username/

    3. Make new redirect If those don't work, you can add your own redirect in .htaccess to just redirect those links. Somewhere after

    RewriteEngine On
    

    add this line of code:

    RedirectMatch 301 ^/~username(.*)$ $1
    


    Taken from https://www.yellowwebmonkey.com/developer-blog/item/removing-the-temporary-url-username-out-of-your-link-after-going-live