jamestl2 Posted June 21, 2007 Posted June 21, 2007 I was just wondering where in cPanel you can set a preference? I want to use the www all across my site, links, etc. Right now my specific reason for this is to add redirects (and remain consistent throughout my site), and I have been told that it makes a difference, because they seem to be faulty without it. Thanks Quote
TCH-Bruce Posted June 21, 2007 Posted June 21, 2007 You would need to add rewrites to your .htaccess file to make it happen. Quote
jamestl2 Posted June 21, 2007 Author Posted June 21, 2007 (edited) Right now my htaccess file contains: ># BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress along with a few already attempted redirects, so what would I change it to? Edited June 21, 2007 by jamestl2 Quote
TCH-Bruce Posted June 21, 2007 Posted June 21, 2007 Or you can just get the WWW-Redirect plugin for Wordpress. Quote
jamestl2 Posted June 21, 2007 Author Posted June 21, 2007 I installed the plugin, but it didn't seem to affect cpanel, where I am still having redirect problems. Quote
TCH-Bruce Posted June 21, 2007 Posted June 21, 2007 Next suggestion, search Google for "force WWW in URL" and you'll find several methods to accomplish it. I thought you wanted something for indexing purposes. That's why I suggested the plugin. Why do you want your cpanel to be redirected? It's not going to be indexed and you are the only one that should be accessing it. Quote
jamestl2 Posted June 21, 2007 Author Posted June 21, 2007 Maybe I'm being unclear, I'm trying to set up redirects "Using" cpanel. On the Add Redirect Page in cpanel it says "http://toptenlisted.com/" I wanted it to say "http://www.toptenlisted.com/" I want to redirect the URL's that Google currently has indexed, For example, I am trying to change my *about page*. Google says my *about page*" URL is: "www.toptenlisted.com/About%20Site.html" So I figured I would go to my redirect page in cpanel and redirect that URL to what my *about page* is currently: "www.toptenlisted.com/ten-things-about-toptenlisted" But this doesn't seem to affect the old URL (it still goes to "www.toptenlisted.com/About%20Site.html" when I enter the link), so I thoought the problem was because the URL did not have the www in front of it, which is what I have read from other various help pages, forums, etc. Hope this clarifies it Quote
heyguy Posted June 21, 2007 Posted June 21, 2007 To remove the www put this in your .htaccess: >RewriteEngine On RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC] RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L] Quote
jamestl2 Posted June 21, 2007 Author Posted June 21, 2007 (edited) To remove the www put this in your .htaccess: >RewriteEngine On RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC] RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L] Would this remove it from everything? (Cpanel redirect page, Google Index, Internal Links, Wordpress, etc.) Also, actually I wanted to *add* it to my URL's Edited June 21, 2007 by jamestl2 Quote
jamestl2 Posted June 21, 2007 Author Posted June 21, 2007 Well, I went ahead and tried that code anyway, but the redirect problem is still the same, as I retried the process as I described earlier. Am I missing a step somewhere when attempting to redirect pages? Because all the result (which is still www.toptenlisted.com/About%20Site.html) gives me is an Error 404 - Not Found page, which still has the same wordpress theme on it, so might there be a problem with the theme's code? Or maybe with its permissions? I'm unsure. Quote
TCH-Bruce Posted June 21, 2007 Posted June 21, 2007 You need to add redirects to the .htaccess file for your pages like this >Redirect permanent /About%20Site.html http://toptenlisted.com/ten-things-about-toptenlisted You will add one line for each redirect and these should be outside of the Wordpress section. Put them either at the top or bottom of the file. Quote
jamestl2 Posted June 21, 2007 Author Posted June 21, 2007 You need to add redirects to the .htaccess file for your pages like this >Redirect permanent /About%20Site.html http://toptenlisted.com/ten-things-about-toptenlisted You will add one line for each redirect and these should be outside of the Wordpress section. Put them either at the top or bottom of the file. Yeah, this produces the exact same result as if I were to enter them on cpanel's *add redirect* page (it entered that information onto my htaccess file), which as I tried earlier, doesn't seem to redirect the old URL to the current one (which is why I thought the problem might be something with the www or non-www.) Quote
heyguy Posted June 21, 2007 Posted June 21, 2007 The www shouldn't make a difference. Is the redirect in place right now? Can you paste the full contents of your .htaccess with the redirect in place? Quote
jamestl2 Posted June 21, 2007 Author Posted June 21, 2007 The www shouldn't make a difference. Is the redirect in place right now? Can you paste the full contents of your .htaccess with the redirect in place? Sure, First here is the process I used to try to redirect: 1. Opened up cpanel and went to the redirect page 2. Typed in my old URL (About%20Site.html ) into the box labeled “http://toptenlisted.com” 3. Typed the current URL (www.toptenlisted.com/ten-things-about-toptenlisted/) into the box labeled “http://” 4. Chose “Permanent” from the drop down box and clicked “Add” Then it says it added it, so I went to test out the redirect by typing “http://www.toptenlisted.com/About%20Site.html” and I get the 404 error page, as if I never came up with a redirect. Here are the current contents of my htaccess file: > Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^toptenlisted\.com RewriteRule ^(.*)$ http://www.toptenlisted.com/$1 [R=permanent,L] # index.php to / RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/ RewriteRule ^(.*)index\.php$ /$1 [R=301,L] # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress RedirectMatch permanent ^/About%20Site.html$ http://www.toptenlisted.com/ten-things-about-toptenlisted Quote
jamestl2 Posted June 22, 2007 Author Posted June 22, 2007 Nope, still nothing, just to make sure I removed the right ones, I changed this: RedirectMatch permanent ^/About%20Site.html$ http://www.toptenlisted.com/ten-things-about-toptenlisted to this: RedirectMatch permanent /About%20Site.html http://www.toptenlisted.com/ten-things-about-toptenlisted Also, I didn't type the code myself (except the two character deletions), this redirect was created through the cpanel redirects page. Quote
TCH-Bruce Posted June 22, 2007 Posted June 22, 2007 Would you please enter it like this as I posted above >Redirect permanent /About%20Site.html http://toptenlisted.com/ten-things-about-toptenlisted I have no idea what a RedirectMatch is Quote
jamestl2 Posted June 22, 2007 Author Posted June 22, 2007 Something else I just noticed is that, while I am on the cpanel redirect page, when I click on the link: http://www.toptenlisted.com/About%20Site.html listed under current redirects, it takes me to an entirely new page that doesn't exist, not even contained in my site, which in the browser says: http://toptenlisted.comhttp//www.toptenlis...out%20Site.html So it seems that what I typed in the first box under "add redirects" isn't even what I really typed for some reason. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.