YellowWebMonkey Web Design

Removing the Temporary Url ~username out of Your Link after Going Live

Ever used a temporary URL with your IP address like http://xxx.xxx.xxx.xxx/~username when building your site but then had the pesky /~username/ stay in the link after going live?  An example would be looking like http://www.mysite.com/~username/contact-us.  Here are some things to check to fix this:

 

1. 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

 

Scroll to Top