• Resolved Ravikumar Patel

    (@ravipatel)


    Now this url display 404 page but need redirect on homepage.
    Another redirection rules working on my site but i have need fix this 4 url.

    rewriterule https://www.xxxx.com/?cat=6(.*)$ https://www.xxxx.com/$1 [r=301,L]
    rewriterule https://www.xxxx.com/?p=1753(.*)$ https://www.xxxx.com/$1 [r=301,L]
    rewriterule https://www.xxxx.com/?page_id=119(.*)$ https://www.xxxx.com/$1 [r=301,L]
Viewing 3 replies - 1 through 3 (of 3 total)
  • Try this

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^([^\.]+)$ $1.php [NC,L]
    
    RewriteEngine On
    RewriteRule ^www.xxxx.com//([^/]*)\.html$ /?cat=6$1 [L]
    
    RewriteEngine On
    RewriteRule ^www.xxxx.com//([^/]*)\.html$ /?p=1753$1 [L]
    
    RewriteEngine On
    RewriteRule ^www.xxxx.com//([^/]*)\.html$ /?page_id=119$1 [L]
    Thread Starter Ravikumar Patel

    (@ravipatel)

    @ajitkhodke : Not working why u have used .html?

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    
    RewriteCond %{HTTP_HOST} !^www.sitename.com$
    RewriteRule ^(.*)$ https://www.sitename.com/$1 [R=301,L]
    
    rewriterule https://www.sitename.com/?cat=6(.*)$ https://www.sitename.com/$1 [r=301,L]
    rewriterule https://www.sitename.com/?p=1753(.*)$ https://www.sitename.com/$1 [r=301,L]
    rewriterule https://www.sitename.com/?page_id=119(.*)$ https://www.sitename.com/$1 [r=301,L] 
    
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
    Thread Starter Ravikumar Patel

    (@ravipatel)

    Redirected you too many times.

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{QUERY_STRING} ^page_id=119$
    RewriteRule ^(.*)$ https://www.sitename.com/$1 [R=301,L]
    </IfModule>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to Redirect Url to homepage? now go on 404 page’ is closed to new replies.