CPanel Redirect not allowing login access.
-
Using the redirect function in cPanel I am able to create the 301 redirect that I need to not have duplicate content issues in Moz. However, the issue now is that when I try to login to domain.com/login it redirects to domain.com/index.php?q=admin, which is not a page on the site and I can no longer login.
I have checked the htaccess file and it appears that the entry is correct ( I originally thought that the cPanel redirect was not writing access correctly ). I am not sure if there is a small detail that I am missing with this or not.
So my main question is how do I redirect my site to remove dup content errors while retaining the login at domain.com/admin and not be redirected to domain.com/index.php?q=admin? Thank you ahead of time for your assistance.
-
Lynn,
Good morning. I tried the above suggestion and it worked! Thank you for your help with this issue!
-
Hi Andrea,
This looks like a drupal issue, not a cpanel issue and I am not that familiar with Drupal.
That being said, are you sure the above htaccess is the complete file that works? If you remove the lines that you say create the issue, you still have this line: RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] which is the one that handles rewriting urls to the form q=admin.
You could try moving the 2 lines of code:
RewriteCond %{HTTP_HOST} ^www.domain.com$
RewriteRule ^(.*)$ "http://domain.com/$1" [R=301,L]To immediately below the 'RewriteEngine on' line (and obviously putting your domain in place of domain.com) so that they run first before the rest of the rules. This might work, but to me the above looks like it will be rewriting to q=admin anyway, so maybe this is a drupal setup issue that I am unfamiliar with.
-
The following is the full htaccess file for the site in question. The CMS that we are using on this site is drupal, with cPanel on the backend server side. I originally thought there was a line that of code that was causing this ( I will be honest, I do not know what each line commands) but when I checked it against other htaccess files the code appeared to be the same.
Options +Indexes FollowSymLinks +ExecCGI
Order allow,deny
Allow from allRewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
RewriteCond %{HTTP_HOST} ^www.domain.com$
RewriteRule ^(.*)$ "http://domain.com/$1" [R=301,L] -
Hi Andrea,
Is that the only code you have in the htaccess file, or are there more lines? What cms are you using?
it seems to me that your cms (or something else) is trying to rewrite internal site search terms (hence the q=admin) but there must be more in your htaccess file for this to be happening. Care to mention the site so I can have a quick look?
-
That is the code that I have currently in my htaccess file. However, the issue is that with this code in my htaccess file I am having an issue where when i type in the URL to log into the site;
With the redirect active I get redirected to the following URL structure;
which is a page that does not exist and therefore gives me a 404 error.
If I remove
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.yourdomain.com$ [NC]
RewriteRule ^(.*)$ http://yourdomain.com/$1 [R=301,L]I can log in. However, this brings back all of the duplicate www. and non-www. issues.
-
Hi Andrea,
What code are you using to to the redirects? If you can edit the htaccess file directly then simply drop the following code into it and all calls to a www url should be redirected to the non www url. No index.html or anything else should be added if you use this, it simply redirects all www to non www urls.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.yourdomain.com$ [NC]
RewriteRule ^(.*)$ http://yourdomain.com/$1 [R=301,L]Is that what you are after?
-
Lynn,
Sorry for the vagueness of the question. The issues I am getting in my Moz report is duplicate content issues resulting from the indexing of both the www. and non-www. sites. I have set my preferred url in WT to be the non-www. and so I want to 301 redirect the www to non-www so I am done in one step, but it appears that in doing this in C-panel causes an issue with the login by appending the /index.html at the end of the login url creating a 404 error. I know I can remove the code to login again from the htaccess file but in removing the redirect I get duplicate content errors again. I was hoping to avoid redirecting every individual page. But is that the solution? Thanks again for the info.
-
Hi Andrea,
I am not sure exactly what dup content issues you are trying to correct...
If you have ftp access then you can simply take out the last lines that were added through cpanel and that should then let you login again. As for the correct setup, give us a few more details on what exactly you are trying to achieve.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
How Critical to Address Redirect Chains?
We have about 100 redirect chains and were not sure of the impact they are having on our SEO. One SEO expert wants to charge around $800 to clean these up for us. Any thoughts on how serious of an issue this is and how important it is to address?
Intermediate & Advanced SEO | | roundtable10 -
Should I redirect off topic blog posts?
We launched a store on top of a popular blog. The blog had nothing to do with the store. The blog has a lot of backlinks and traffic, but our store is now our primary business. I am concerned that the off topic blog content may be affecting or ability to rank better for the core store business. Should we delete or redirect the old blog content to another website to improve the SEO for our store?
Intermediate & Advanced SEO | | seo-mojo1 -
International SEO and Website Redirection
Hey there Mozzers, If you have a website for example www.example.com and you wanted to target Australia and UK and you owned the .com.au and .co.uk. Would that be ok if everything redirected to the .com ? I know that having the .com.au is a signal for Google but the redirection is causing me troubles. Would that be huge of a difference if everything redirected to the .com version of the site?
Intermediate & Advanced SEO | | AngelosS0 -
Why is this url redirecting to our site?
I was doing an audit on our site and searching for duplicate content using some different terms from each of our pages. I came across the following result: www.sswug.org/url/32639 redirects to our website. Is that normal? There are hundreds of these url's in google all with the exact same description. I thought it was odd. Any ideas and what is the consequence of this?
Intermediate & Advanced SEO | | Sika220 -
301 Redirect and Webmaster Central
I've been working on removing canonical issues. My host is Apache. Is this the correct code for my htaccess? RewriteEngine On
Intermediate & Advanced SEO | | spkcp111
RewriteCond %{HTTP_HOST} ^luckygemstones.com$ [NC]
RewriteRule ^(.*)$ http://www.luckygemstones.com/$1 [R=301,L] SECOND!!! I have two websites under Google's Webmaster Central; http://luckygemstones.com which gets NO 404 soft errors... AND http://www.luckygemstones.com which has 247 soft 404 errors... I think I should DELETE the http://luckygemstones.com site from Webmaster Central--the 301 redirect handles the"www" thing. Is this correct? I hate to hose things (even worse?) Help! Kathleen0 -
Temporary Redirects on Magento
I've recently taken over a client who uses the Magento platform and there was definitely a duplicate issue with his homepage. It redirected www to non www, however the canonical tag was setup wrong and pointing to the www version. When I looked at OSE for both versions the non www has only 7 linking domains and a page authority of 32. The www version has 24 linking domains and page authority of 39. As the domain is fairly new, I decided to redirect the non www to www and keep the canonical the same. (I changed the internal linking structure etc). When I run both URLs through this tool: http://www.ragepank.com/redirect-... it's returning a whole bunch of 302, rather than 301 redirects. What's the deal with that? Is that a Magento setting that I can fix or something a little harder? I'm not sure if it's proper etiquette to post the URL of a client, so if that would help and is OK, please let me know. Thanks
Intermediate & Advanced SEO | | bradkrussell1 -
Login redirect 302
Ok - anyone knows what to do with the temporary redirect to the login page? In our e-commerce system we have a checkout page, which requires user to be logged in - if they are not, we redirect them to the login page using simple php header("Locaiton: url"). This however has been found as a Warning as it's a temporary redirect. I can't really put there permanent redirect for obvious reasons so if someone could give me some clue on this situation that would be much appreciated.
Intermediate & Advanced SEO | | coremediadesign0 -
Buying an existing domain with higher ranks for redirecting
I've recently came across one of my competitors who's looking to sell their domain. Now they currently rank higher than my primary site for a few keywords we are targeting. Would it be wise to buy the domain and do a name server change over to my primary domain? Would it even help boost ranks for the keywords they rank higher for? Or will the link juice be minimal? Any thoughts would be great!
Intermediate & Advanced SEO | | upick-1623910