• I am a newbie to web technologies and yesterday i deleted my wordpress site and reinstalled it by deleting all the databsse table and folders. Now my blog URL is http://rohbits.com/blog and i wanted every request to rohbits.com to be redirected to http://rohbits.com/blog but the problem is that i am when i changed the redirect rules in my cpanel, i am getting “This webpage has a redirect loop”. I don’t know what to do. I have hosted my site on hostgators and after i removed all the files and database, i am not able to install wordpress in the root folder. Please provide me with your valued help

Viewing 3 replies - 1 through 3 (of 3 total)
  • Remove the redirects in cPanel.

    Thread Starter Mithun Baiju

    (@mithun-baiju)

    but then it wont redirect any user who is visiting rohbits.com

    Thread Starter Mithun Baiju

    (@mithun-baiju)

    okay i have found a simple solution to it. I removed redirection rules from cpanel and add these code to my htaccess file

    # Turn on rewrites.
    RewriteEngine on
    
    # Only apply to URLs on this domain
    RewriteCond %{HTTP_HOST} ^(www.)?rohbits.com$
    
    # Only apply to URLs that aren't already under folder.
    RewriteCond %{REQUEST_URI} !^/blog/
    
    # Don't apply to URLs that go to existing files or folders.
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    
    # Rewrite all those to insert /folder.
    RewriteRule ^(.*)$ /blog/$1
    
    # Also redirect the root folder.
    RewriteCond %{HTTP_HOST} ^(www.)?rohbits.com$
    RewriteRule ^(/)?$ blog/ [L]
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘How to fix the redirect loop.’ is closed to new replies.