J'ai cette URL et je dois saisir les balises et réécrire l'URLComment regex et .htaccess réécrire url
Ainsi, dans l'exemple ci-dessus pour faire quelque chose comme http://beantownbride.com/?s=Social+Media
Voici ce que j'ai jusqu'à présent pour mon fichier .htaccess
RewriteRule ^http://beantownbride.com/darkroom/mt/mt-search.cgi?blog_id=(*.)&tag=(*.) http://beantownbride.com/?s=$2
mais il ne fonctionne que pour la première balise (si i t fonctionne à tous)
l'ensemble du fichier .htaccess
RewriteEngine On
# BEGIN WordPress
#MT to WP
# Convert old archives
RewriteRule ^/archives/([0-9]*)\.php$ /$1/ [R=301,L]
RewriteRule ^/archives/([0-9]*)\.html$ /$1/ [R=301,L]
RewriteRule ^/archives/([0-9]*)\.shtml$ /$1/ [R=301,L]
RewriteRule ^/archives/([0-9][0-9][0-9][0-9]/[0-9][0-9]/.*)\.php$ /$1/ [R=301,L]
RewriteRule ^/archives/old/([0-9]*)\.php$ /$1/ [R=301,L]
RewriteRule ^/archives/cat_(.+)\.php$ /category/$1/ [R=301,L]
RewriteRule ^/archives/cat_(.+)\.html$ /category/$1/ [R=301,L]
RewriteRule ^/archives/cat_(.+)\.shtml$ /category/$1/ [R=301,L]
RewriteRule ^/archives/?$ /archive/ [R=301,L]
RewriteCond %{REQUEST_URI} !^/archives/[0-9][0-9][0-9][0-9]/[0-9][0-9]/?.*$ [NC]
RewriteCond %{REQUEST_URI} !^/archives/[0-9][0-9][0-9][0-9][0-9][0-9]\.?.*$ [NC]
RewriteCond %{REQUEST_URI} !^/archives/tag/.*$ [NC]
RewriteCond %{REQUEST_URI} !^/archives/author/.*$ [NC]
RewriteRule ^/archives/(.*)$ /category/$1 [R=301,L]
RewriteRule ^/archives/(.*)$ /$1 [R=301,L]
# Change underscores hyphens
RewriteRule ^/category/([^_]*)_([^_]*)_([^_]*)_(.*)$ /category/$1-$2-$3-$4/ [R=301,L]
RewriteRule ^/category/([^_]*)_([^_]*)_(.*)$ /category/$1-$2-$3/ [R=301,L]
RewriteRule ^/category/([^_]*)_(.*)$ /category/$1-$2/ [R=301,L]
RewriteRule ^/([0-9][0-9][0-9][0-9]/[0-9][0-9])/([^_/]*)_([^_/]*)_([^_/]*)_(.*)/(.+)$ /$1/$2-$3-$4-$5/$6 [R=301,L]
RewriteRule ^/([0-9][0-9][0-9][0-9]/[0-9][0-9])/([^_/]*)_([^_/]*)_(.*)/(.+)$ /$1/$2-$3-$4/$5 [R=301,L]
RewriteRule ^/([0-9][0-9][0-9][0-9]/[0-9][0-9])/([^_/]*)_(.*)/(.+)$ /$1/$2-$3/$4 [R=301,L]
# Change to wordpress feeds
RewriteRule ^/atom$ /wp-atom.php [R=301,L]
RewriteRule ^/atom\.xml$ /wp-atom.php [R=301,L]
RewriteRule ^/index\.atom$ /wp-atom.php [R=301,L]
RewriteRule ^/index\.rdf$ /wp-rdf.php [R=301,L]
RewriteRule ^/index\.xml$ /wp-rss2.php [R=301,L]
RewriteRule ^/rss\.xml$ /wp-rss.php [R=301,L]
Redirect permanent /rss.xml /feed/
RewriteRule ^/([0-9][0-9][0-9][0-9]/[0-9][0-9]/.*)\.atom$ /$1/feed/ [R=301,L]
RewriteRule ^/([0-9][0-9][0-9][0-9]/[0-9][0-9]/.*)\.atom/$ /$1/feed/ [R=301,L]
RewriteRule ^/([0-9][0-9][0-9][0-9]/[0-9][0-9]/.*)\.xml$ /$1/feed/ [R=301,L]
RewriteRule ^/([0-9][0-9][0-9][0-9]/[0-9][0-9]/.*)\.xml/$ /$1/feed/ [R=301,L]
Redirect permanent /about.html /about
Redirect permanent /advertise.html /advertise
Redirect permanent /contact.html /contact
Redirect permanent /welcome-about/ /about/
Redirect permanent /welcome-about/welcome-to-my-blog.html /about/
Redirect permanent /real-wedding /real-weddings
RewriteRule ^/events/(.*)$ /?s=events
#http://beantownbride.com/darkroom/mt/mt-search.cgi?blog_id=1&tag=Social%20Media&limit=20&IncludeBlogs=1
#RewriteRule ^/darkroom/mt/mt-search.cgi?blog_id=1&tag=(*.)&limit
#http://beantownbride.com/?s=test+tag+blah
#RewriteRule ^http://beantownbride.com/darkroom/mt/mt-search.cgi?blog_id=(.*)&tag=(.*)$ http://beantownbride.com/?s=$2
RewriteRule ^http://beantownbride.com/darkroom/mt/mt-search.cgi?blog_id=(.*)&tag=(.*)$ http://beantownbride.com/?s=$2
<IfModule mod_rewrite.c>
RewriteBase/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Qu'entendez-vous par _ "le premier tag" _? Y a-t-il plus d'un paramètre 'tag'? – jwueller
Non, comme si j'ai plusieurs tags comme Social + Media – Alex