Rewrite a specific URL to another directory

I'm trying to redirect this,

example.com/ slide? page = 4 on example.com/ slide / issue43? page = 4

But it cannot affect other urls like example.com/ slide / issue57? Page = 4

Im really stuck, these regular expressions are so weird. Here is the correspondence that I came up with,

This is not working    
RewriteRule ^slide?page(.*)$ http://example.com/slide/issue43?page=$1 [L,R=301]

I need to set up “ slide? Page = X ” and redirect or specify “ slide / problem43? Page = X '

+3
source share
1 answer

This should work for you:

RewriteCond %{REQUEST_URI} ^/slide$
RewriteCond %{QUERY_STRING} ^page=(.*)$
RewriteRule ^(.*) /slide/issue57?page=%1 [R=301,L]
+1
source

All Articles