Home the right way redirect url using .htaccess
Reply: 0

the right way redirect url using .htaccess

user1596 Published in May 25, 2018, 11:11 am

what is the right way to redirect page using .htaccess?

for ex i want to redirect myweb.com/dorama/901110204/todome-no-kiss--paralel to myweb.com/dorama/1101071510/todome-no-kiss--parallel

but when i try to access old link, link direct to myweb.com/dorama/1101071510/todome-no-kiss--parallel?cat=dorama&idp=901110204&post=todome-no-kiss--paralel

my full .htaccess file

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

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

    #Redirect Dead Link
    Redirect 301 /dorama/901110204/todome-no-kiss--paralel http://www.piratefiles.org/dorama/1101071510/todome-no-kiss--parallel
    Redirect 301 /dorama/601181905/life-as-a-girl http://www.piratefiles.org/dorama/1101072233/life-as-a-girl
    Redirect 301 /dorama/801130021/todome-no-kiss http://www.piratefiles.org/dorama/1101071405/todome-no-kiss

    RewriteRule ^([A-Za-z]+)/([0-9]+)/([\w-]+)/?$    view.php?cat=$1&idp=$2&post=$3&%{QUERY_STRING}   [NC,L]
    RewriteRule ^category/([\w-]+)/?$ category.php?cat=$1&%{QUERY_STRING}   [NC,L]

    # To externally redirect /dir/abc.php to /dir/abc
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+(.+?)\.php[\s?] [NC]
    RewriteRule ^ /%1 [R=301,L,NE]

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}.php -f
    RewriteRule ^(.+?)/?$ $1.php [QSA,NC,L]


ErrorDocument 404 http://www.piratefiles.org/404.php
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.305563 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO