I've migrated a custom ASP CMS to Wordpress. I need to 301 redirect:
https://example.com/products/*.aspx
to
https://example.com/*
How do I do this? Thanks.
If it's only for this file, you can use:
RewriteEngine on
RewriteRule ^products/(.+)\.aspx$ $1 [NC,R=301,L]
Related
I'd like to do a redirect with htaccess file of my old links
www.domain.com/220262/page.html to www.domain.com/video/220262/page.html
thank you
This should work:
RewriteEngine On
RewriteRule ^([0-9]+)/page.html /video/$1/page.html [R=301,L]
I have a url condo-search.co and it loads a blank page, I want to direct it to condo-search/en/index.php how do i do that using htaccess?
You can add this:
RedirectMatch 301 ^/$ /en/index.php
in your document root's htaccess file. Or if you want it to not externally redirect:
RewriteEngine On
RewriteRule ^$ /en/index.php [L]
I want to redirect my domain: http://www.domain.com/index.php to http://www.domain.com. How do I accomplish this task through htaccess?
I am new in htaccess so I'm asking for your help. Thanks.
RewriteRule ^index\.php$ / [NC,R,L]
I had an old site implemented on liferay. All the links were like
www.site.com/web/something
I want to write a htaccess rule so that all the requestes with /web/* should
be redirected to the homepage permanenty...
Now for individual url i have wrote this.
Redirect 301 /web/contact http://www.site.com/contact
Is there a wildcard method or something for this?
How about this which redirects /web/something to http://site.com/something:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^web/(.*) http://site.com/$1 [R=301,L]
</IfModule>
Or anything anything starting with /web/ redirects to homepage:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^web/.* http://site.com/ [R=301,L]
</IfModule>
Alternatively, staying within mod_alias, you can just use RedirectMatch to use a wildcard:
RedirectMatch 301 /web/(.*) http://www.site.com/$1
Does anyone have a simple way of rdirected in .htaccess all pages that were once .asp to now be .php. For example index.asp is now index.php etc. Server is apache.
RewriteEngine on
RewriteRule ^(.+)\.asp$ $1.php