Home 301 Redirect with RewriteRules and 404
Reply: 0

301 Redirect with RewriteRules and 404

user941
1#
user941 Published in May 21, 2018, 11:17 am

I'm using .htaccess setup to rewrite my urls on domain.com from domain.com/index.php?id=1&... to seo friendly urls: www.domain.com/seo-friendly-url/23408425 , this way:

ErrorDocument 404 /404.php
RewriteEngine on
RewriteCond %{DOCUMENT_ROOT} !-f
RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [L,R=301]
RewriteRule !\.(js|bmp|txt|ico|gif|jpg|png|css|html|htm|swf|flv|xml|bat|ttf|php|mp3|doc|docx|pdf|xls|xlsx|dwg|zip|rar|csv)$ index.php [QSA,L,NC]
Redirect 301 old-seo-url http://www.domain.com/seo-friendly-url/13148934300

After migration from a non-cms site I'm trying to 301 redirect an old website's link: http://www.domain.com/old-seo-url
to my structure: http://www.domain.com/seo-friendly-url/13148934300

, but can't find the right way. The standard 301 redirects are not doing anything. Any tips are welcome. Thank you

You need to login account before you can post.

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

© 2016 Powered by mzan.com design MATCHINFO