Home Htaccess: Redirecting Page to New URL
Reply: 0

Htaccess: Redirecting Page to New URL

Omotayo3i Published in 2017-11-12 08:32:29Z

I have these rewrite rules in my .htaccess

RewriteRule ^download-mp3/?$ music/index.php
RewriteRule ^download-mp3/([0-9]+)-(.*)$ music/view.php?id=$1 [L]
RewriteRule ^music/([0-9]+)-(.*)$ music/view.php?id=$1 [L] 

This is the url https://www.myweb.com/download-mp3/2735-masterkraft-yapa-remix-feat-wizkid-cdq-reekado-banks but i want url redirected and transformed to https://www.myweb.com/mp3-download/2735-masterkraft-yapa-remix-feat-wizkid-cdq-reekado-banks

So i added this to my .htaccess file.

RedirectMatch 301 ^/download-mp3/?(.*)?$ /mp3-download/$1 

The above works but its adding ?id=2735 add the end of the rewrite which is not specified in the rule.



Expected Output


You need to login account before you can post.

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

© 2016 Powered by mzan.com design MATCHINFO