Posts

Showing posts with the label htacess

htaccess: Redirecting multiple domains to the main domain

Let's say this is the main domain: mywebsite.com.au And you'd like to redirect several other domains that you have purchased to this main domain.The steps shown below redirects all www, non-www, http and https variations and also matches the internal pages. Step 1: Go to your DNS provider's website and point each of those purchased domains to the server that is hosting your main domain. In other words, add the IP address of your hosting server in the A record. Step 2: Log in to your WHM. Then park each domain on top of the main domain. You may be able to do this in cPanel > Aliases but I haven't tried. Step 3: If you have AutoSSL enabled, all the additional parked domains will automatically get SSL added. This may take some time. Alternatively, you can go to WHM > Manage AutoSSL and Run AutoSSL Check. Step 4: Add your parked domains to your .htaccess file as shown below. Note the "$" at the end of this line: ^www\.mywebsite\.com$ . This ...

Step-by-step guide to transfering your web hosting to a new web host with domain transfer

If you are planning to move your website to a new host along with domain transfer, here are some easy tips to follow. First, allow plenty of time- at least a week before your hosting plan expires. You do not have to let your existing host know about your plan to move away from them. However, you have to be aware of the auto-renewal feature. Your existing host may have auto-renewal turned on in your account. What this does is - they auto renew your hosting and/or domain 7 to 14 days prior to the expiry date. If you are not sure, check with them if they have auto-renewal enabled in your account. If they have it enabled, request for the auto-renewal to be turned off. You can then take your time to transfer your hosting and/or domain. Backup everything from your existing web space - all files and folders inside the /public_html or /www folder and the databases.

Concrete 5: .htaccess redirect - add .html extension

If you want to add .html extension to the end of the URL, try the code below in your .htaccess file. Also make sure Pretty URL is enabled from Dashboard. RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME}/index.html !-f RewriteCond %{REQUEST_FILENAME}/index.php !-f # Rewrite rule for displaying as directories #RewriteRule ^(.*)$ index.php/$1 [L] # disable this # Rewrite rule for appending .html RewriteRule ^(.*)\/$ $1.html [R] RewriteRule ^(.*).html$ index.php/$1 [L]

Removing index.php in Codeigniter using XAMPP on Windows

Using the method below, you can access your site http://localhost/Mysite/index.php/welcome without the index.php like this: http://localhost/Mysite/welcome I did this in Code Igniter 2.0.3 using XAMPP 1.7.1 on Windows 7. Create .htaccess file in the root folder of code igniter. I got the code below from http://codeigniter.com/wiki/mod_rewrite/ . Make sure you use your site folder name in Rewrite Base below:     RewriteEngine On     RewriteBase /Mysite/     #Removes access to the system folder by users.     #Additionally this will allow you to create a System.php controller,     #previously this would not have been possible.     #'system' can be replaced if you have renamed your system folder.     RewriteCond %{REQUEST_URI} ^system.*     RewriteRule ^(.*)$ /index.php?/$1 [L]         #When your application folder isn't i...