Nomax Member May 5, 2014 #1 Hello, after importing to xen and using redirects. Few attachment url's are not working. How ever the attachment is on the database. So, how do i redirect this Code: /download.php?id=77276 to this Code: /attachments/77276 Last edited: May 5, 2014
Hello, after importing to xen and using redirects. Few attachment url's are not working. How ever the attachment is on the database. So, how do i redirect this Code: /download.php?id=77276 to this Code: /attachments/77276
Nomax Member May 5, 2014 #3 MattW said: Are you using apache? Click to expand... Yes Matt. Also, i have enabled full friendly url's and also edited my above post. Last edited: May 5, 2014 Upvote 0 Downvote
MattW said: Are you using apache? Click to expand... Yes Matt. Also, i have enabled full friendly url's and also edited my above post.
Jake Bunce Well-known member May 5, 2014 #4 Assuming those are root locations, add these rules to the top of the .htaccess file in your web root: Code: RewriteEngine On RewriteCond %{QUERY_STRING} (^|\?)id=([0-9]+)($|&) RewriteRule ^download\.php$ /attachments/%2/? [R=301,L] Upvote 0 Downvote
Assuming those are root locations, add these rules to the top of the .htaccess file in your web root: Code: RewriteEngine On RewriteCond %{QUERY_STRING} (^|\?)id=([0-9]+)($|&) RewriteRule ^download\.php$ /attachments/%2/? [R=301,L]
Nomax Member May 5, 2014 #5 Jake Bunce said: Assuming those are root locations, add these rules to the top of the .htaccess file in your web root: Code: RewriteEngine On RewriteCond %{QUERY_STRING} (^|\?)id=([0-9]+)($|&) RewriteRule ^download\.php$ /attachments/%2/? [R=301,L] Click to expand... You the man. Thanks a ton Upvote 0 Downvote
Jake Bunce said: Assuming those are root locations, add these rules to the top of the .htaccess file in your web root: Code: RewriteEngine On RewriteCond %{QUERY_STRING} (^|\?)id=([0-9]+)($|&) RewriteRule ^download\.php$ /attachments/%2/? [R=301,L] Click to expand... You the man. Thanks a ton