Forums

[resolved] How to redirect a certain link (13 posts)

  1. Dil
    Member
    Posted 4 months ago #

    I want to redirect the page http://www.ephp.in/2010 to the page http://www.ephp.in

    The problem is that the the slug http://www.ephp.in/2010 is already taken so I am not able to create a page with the same name ..

    1. Is there any way to delete the slug so that I can create a page with the URL http://www.ephp.in/2010.. Now when I am tying to change the permalink the URL becomes http://www.ephp.in/2010-1..

    How do I correct this problem .. Can anyone help me in this ..

  2. esmi
    Theme Diva & Forum Moderator
    Posted 4 months ago #

    Try empyting your Trash first...

  3. Dil
    Member
    Posted 4 months ago #

    I have removed all the trash.. I think the permalink is already made.. is there anyway to manually remove it

  4. Janetfl
    Member
    Posted 4 months ago #

    Where is the trash?

  5. Dil
    Member
    Posted 4 months ago #

    I think the trash is in your wordpress admin panel where you can delete a post or a page ..

    is that correct ..

  6. Dil
    Member
    Posted 4 months ago #

    I have not yet got the solution on this .. can any one help me on this ..

  7. shaile
    Member
    Posted 4 months ago #

  8. Dil
    Member
    Posted 4 months ago #

    Thanks ..

    But the problem is that I am not able to create a page or URL http://www.ephp.in/2010

  9. Dil
    Member
    Posted 4 months ago #

    Sorry .. I am still trying to find a solution for this..

    Can anyone help me in this..

  10. Don't bump, someone would have helped you out anyway. ;)

    You want http://www.ephp.in/2010 to got to http://www.ephp.in/ but need anything afterwards to still work such as http://www.ephp.in/2010/x/y/z/? Try making an explicit redirect before the WordPress portion in your .htaccess file.

    Make a copy of .htaccess and save that somewhere safe. This is just in case you make a gross typo error.

    Add these lines to the top of your .htaccess

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule ^2010$ http://www.ephp.in/ [R=301,L]
    RewriteRule ^2010/$ http://www.ephp.in/ [R=301,L]
    </IfModule>

    That should match only http://www.ephp.in/2010 and http://www.ephp.in/2010/ (with the trailing /) and leave the other URLs alone such as http://www.ephp.in/2010/01/.

    And if that completely doesn't work, or your blog generates errors, just put back that .htaccess file copy you made.

  11. Dil
    Member
    Posted 4 months ago #

    Hey thanks a lot ..

    hey I want http://www.ephp.in/2010 to got to http://www.ephp.in/archives/category/2010

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    RewriteRule ^2010$ http://www.ephp.in/archives/category/2010 [R=301,L]
    RewriteRule ^2010/$ http://www.ephp.in/archives/category/2010 [R=301,L]
    </IfModule>

    # END WordPress

    Is there any mistakes.. its not working for me

  12. Nor would it: you've put your additions after the the RewriteRule . /index.php [L] :) The WordPress index.php is the last rule that get's executed.

    Take those two lines your added and put them before the # BEGIN WordPress so it looks like this:

    # Rewrite rules before WordPress
    <IfModule mod_rewrite.c>
    RewriteRule ^2010$ http://www.ephp.in/archives/category/2010 [R=301,L]
    RewriteRule ^2010/$ http://www.ephp.in/archives/category/2010 [R=301,L]
    </IfModule>
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    As usual, make a backup copy of .htaccess before editing.

  13. Dil
    Member
    Posted 4 months ago #

    Hey thanks a lot Jan..

    The problem in solved .. The community here is great ..

Reply

You must log in to post.

About this Topic