Some mod_rewrite help please.
-
Hi,
I’d like to know how to convert the new WP urls, to those used by my old MT installation.
The old MT URL: https://www.twenty4.org/archives/2004/01/04/ipod_speakers/
The new WP URL: https://www.twenty4.org/archives/2004/01/04/ipod-speakers/
Notice the “-?? instead of “_?? in the WP URLs.
This is what I have in my .htaccess mod_rewrite section.
<pre>RewriteEngine On
</pre>
RewriteBase /
RewriteRule ^archives/([0-9]{4})?/?([0-9]{1,2})?/?([0-9]{1,2})?/?([0-9a-z-]+)?/?([0-9]+)?/?$ /index.php?year=$1&monthnum=$2&day=$3&name=$4&page=$5 [QSA]
RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([0-9a-z-]+)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?year=$1&monthnum=$2&day=$3&name=$4&feed=$5 [QSA]
RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([0-9a-z-]+)/trackback/?$ /wp-trackback.php?year=$1&monthnum=$2&day=$3&name=$4 [QSA]
RewriteRule ^archives/category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?category_name=$1&feed=$2 [QSA]
RewriteRule ^archives/category/?(.*) /index.php?category_name=$1 [QSA]
RewriteRule ^archives/author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?author_name=$1&feed=$2 [QSA]
RewriteRule ^archives/author/?(.*) /index.php?author_name=$1 [QSA]
RewriteRule ^feed/?([0-9a-z-]+)?/?$ /wp-feed.php?feed=$1 [QSA]
RewriteRule ^comments/feed/?([0-9a-z-]+)?/?$ /wp-feed.php?feed=$1&withcomments=1 [QSA]
As you may have gathered, what I want to do is instead of WP converting spaces in post titles to “-“, I would like them converted to “_”.
Can anyone please help?
- The topic ‘Some mod_rewrite help please.’ is closed to new replies.