Jump to content

301 redirect help needed


Saurabh Jain

Recommended Posts

Posted

21 April 2015 - 07:09 AM

I have changed the domain

http://mechanical-engineering.in to http://mechanical-engg.com 

The board is in the url http://mechanical-engg.com/forum

The index page of mechanical-engg.com is using IP content and it takes the page to http://mechanical-en....php/index.html


Q1 Where should I redirect code and what should be the code...

I tried using cpanel redirtect

it worked for mechanical-engineering.in but not for / forum

additionally while changing address in Google webmaster it gave me the following error



Confirm that 301-redirects work properly
URLs from your old site should be redirected to your new site using permanent 301-redirect directives.
The old site redirects to mechanical-engg.com/index.php/index.html, which does not correspond to the new site you chose.

Please advise

Regards
Saurabh
Posted

This is my .htaccess file for my forum.

<IfModule mod_rewrite.c>
Options -MultiViews +FollowSymlinks 
RewriteEngine on

RewriteCond %{HTTP_HOST} ^www.eastmidlandsstargazers.co.uk [NC]
RewriteRule ^(.*)$ http://www.eastmidlandsstargazers.org.uk/$1 [L,R=301]

RewriteCond %{HTTP_HOST} ^eastmidlandsstargazers.co.uk [NC]
RewriteRule ^(.*)$ http://www.eastmidlandsstargazers.org.uk/$1 [L,R=301]

RewriteBase /
RewriteCond %{REQUEST_FILENAME} .*\.(jpeg|jpg|gif|png)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . /public/404.php [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

The 301 redirects will redirect any URL starting with eastmidlandsstargazers.co.uk to the same URL, only starting with eastmidlandsstargazers.org.uk.

eastmidlandsstargazers.co.uk/index.php redirects to eastmidlandsstargazers.org.uk/index.php
eastmidlandsstargazers.co.uk/gallery/ redirects to eastmidlandsstargazers.org.uk/gallery

It was the cleanest way I could find to do it.

Posted

I have added the lines


<IfModule mod_rewrite.c>
Options -MultiViews +FollowSymlinks 
RewriteEngine on

RewriteCond %{HTTP_HOST} ^www.mechanical-engineering.in [NC]
RewriteRule ^(.*)$ http://www.mechanical-engg.com/$1 [L,R=301]

RewriteCond %{HTTP_HOST} ^mechanical-engineering.in [NC]
RewriteRule ^(.*)$ http://www.mechanical-engg.com/$1 [L,R=301]

RewriteBase /
RewriteCond %{REQUEST_FILENAME} .*\.(jpeg|jpg|gif|png)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . /public/404.php [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

 

it is  directing  http://mechanical-engineering.in/    but not  http://mechanical-engineering.in/forum/

 

I have .htaccess file in /forum directory also

  with 

<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /forum/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /forum/index.php [L]
</IfModule>

 

 

 

...

Regards

Saurabh

Posted

I think the .htaccess in /forum will be causing your issue. Rename it to .htaccess~ for a moment and see if the problem is resolved.

I can confirm the redirect .htaccess I used works for me on sub directories as I tested it.

Posted

Thx again ...

 

 

Yes It worked  however all tabs   on nviigation bar showed      Could not find this page error   so I have to put it back   the .htaccess file

 

My code in .htaccess file is

<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /forum/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /forum/index.php [L]
</IfModule>

Posted
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On

RewriteCond %{HTTP_HOST} ^www.mechanical-engineering.in [NC]
RewriteRule ^(.*)$ http://www.mechanical-engg.com/$1 [L,R=301]

RewriteCond %{HTTP_HOST} ^mechanical-engineering.in [NC]
RewriteRule ^(.*)$ http://www.mechanical-engg.com/$1 [L,R=301]

RewriteBase /forum/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /forum/index.php [L]
</IfModule>

@Saurabh Jain, try the above as the forums .htaccess

Posted
Posted

If you want to make this simple, do the following.

Setup the old domain on your server/hosting, pointed to a different directory, not parked on the same account.

Then use a simple htaccess 301 re-direct in the root folder that the domain resolves to. 

Options +FollowSymLinks
RewriteEngine On
redirect 301 / http://mechanical-engg.com

Be sure to remove all the other rewrite stuff you have tried.

Posted

New domain is addon domain

and old domain  is the main domain

How this can be changed?

​Change the domain, don't park the new one on top of the old one, it would all depend on your server setup and control panel/configuration. Without knowing your setup, ask your host to help you.

Posted

As suggested 

 

I have pointed -   mechanical-engineering.in   to new directory

 

In mechanical-engg.com   root directory 

there is one .htaceess file with

<IfModule mod_rewrite.c>
Options -MultiViews +FollowSymlinks 
RewriteEngine on


RewriteBase /
RewriteCond %{REQUEST_FILENAME} .*\.(jpeg|jpg|gif|png)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . /public/404.php [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

 

If I rename thsi file.... I am getting 404 errors in website....

 

In mechanical-engineering.in   - I have created .htacess file and written teh above limes

Options +FollowSymLinks
RewriteEngine On
redirect 301 / http://mechanical-engg.com

 

 

 

 

Now I am not able to login toa dmin panel as well

 

 

Posted

Nothing is working/.... all dirctories now showing internal server errors.....

Support team has mot even read the ticket from last 24 hours............

Should I talk to webhost to restore my old backup..................

 

First time - it seems as a frustartaion from IPS suipport.... in Last 6 uyear  it has never been the case...........

Posted

Done as suggested ...   but now I am not able to login in admin panel too

 

http://mechanical-engg.com/forun/admin/

Sorry, we couldn't find that!

 

​Well, there's a clear reason for that; you spelt it wrong. If you go to the correct address, then the log-in box does appear. That might not explain all the other problems you're experiencing but at least there's an easy explanation for this one.

Posted

that was typing manually  

​Well, there's a clear reason for that; you spelt it wrong. If you go to the correct address, then the log-in box does appear. That might not explain all the other problems you're experiencing but at least there's an easy explanation for this one.

​The final status 

 

After changing domain   and adding redirection - I am having the following two issues

 

Issues....
1. mechanical-engineering.in/forum/admin/   is redirecting  to   http://mechanical-engg.com/admin/   (instaed of /forum/admin)
mechanical-engineering.in/forum/   is redirecting to   home page  http://mechanical-engg.com
 
Rest all blog post and topics are redirecting correctly
 
2 Images missing including logo image  and it is still showing of old domain
 
Seeking guidance to resolve 
Regards
Saurabh
 
--------------------
 
Deatils 

 

Old domain

http://mechanical-engineering.in   pointed to empty directory

 

new domain

http://mechanical-engg.com

 

Board installed in / forum directory 

http://mechanical-engg.com/forum/

 

IP content home page on   ->  http://mechanical-engg.com    -> http://mechanical-engg.com/index.html

 

---------------------

 

.htaccess file

 

in  http://mechanical-engineering.in  (old domain)

 

Options +FollowSymLinks
RewriteEngine On
 
.htaccess in  mechanical-engg.com  (new domain)
 
 
<IfModule mod_rewrite.c>
Options -MultiViews +FollowSymlinks 
RewriteEngine on
 
 
RewriteBase /
RewriteCond %{REQUEST_FILENAME} .*\.(jpeg|jpg|gif|png)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . /public/404.php [L]
 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
 
------------------
 
.htaccess file in  mechanical-engg.com/forum/
 
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /forum/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /forum/index.php [L]
</IfModule>
 
-------
 
 
Issues....
1. mechanical-engineering.in/forum/admin/   is redirecting  to   http://mechanical-engg.com/admin/   (instaed of /forum/admin)
mechanical-engineering.in/forum/   is redirecting to   home page  http://mechanical-engg.com
 
Rest all blog post and topics are redirecting correctly
 
2 Images missing including logo image  and it is still showing of old domain
 
Regards
Saurabh
 
 

 

 

 

 

Posted

try clearing your browser cache, I'm able to load your admincp just fine using the old or the new of http://mechanical-engg.com/forum/admin/

 

On the logo, use your easy logo changer, select your skin, and update the url properly and save.  Be sure your uploads path and url in your general configuration is also correct. Re-cache your skins if needed too.

 

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...