Why modify the htacess? Can’t you modify the XML file or the script you’re using to make the part number part of the title of the post? Then presto, it’s in the URL.
Hi Andrea,
Thank you for your response.
We are getting the XML from external source. Please review the below links to view how we are getting the wheel information through XML links.
http://asp.wheelpros.com/cs/brands/wsg.ashx?service=groups&siteid=3
http://asp.wheelpros.com/cs/brands/wsg.ashx?service=styles&siteID=3&groupid=15
As specified, when clicked on the wheel image, the URL need to be http://www.wheelprosdev.com/kmcdev/wheels/KMC/1272
Looking forward to hear from you.
Thanks,
Right, that’s your source XML – what are you using to stuff them into posts/pages?
That’s what I’m suggesting you change.
If you’re importing these as posts (versus just calling the XML file) then you can have the import define the postname. But … we seem to be going the long way around. This doesn’t strike me as really a WordPress question (unless you’re using a plugin to pull in the XML stuff) so here’s advice.
You’re looking to redirect QUERY strings, which is NOT the same as redirecting static links.
Read http://corz.org/serv/tricks/htaccess2.php
We are pulling the data directly from the XML and showing on the site. We are not inserting them as posts. Below is our .htaccess code. Please review and let me know if we need to change any thing on this.
=======================================================================
# BEGIN WordPress
# For security reasons, Option followsymlinks cannot be overridden.
#Options +FollowSymLinks
Options +SymLinksIfOwnerMatch
AddType video/quicktime mp4,m4v
RewriteEngine On
RewriteBase /
RewriteRule ^kmcdev/wheels/([^/]*)/([^/]*)/([^/]*)/$ http://www.wheelprosdev.com/kmcdev/wheels/?siteid=$1&groupid=$2&groupname=$3 [L]
#RewriteRule ^about/?([^/]*)/([^/]*)/$ http://www.wheelprosdev.com/about/?param1=$1¶m2=$2 [QSA,L]
#RewriteRule ^kmcdev/link/ rewrite.php?link=$1 [QSA,L]
RewriteRule ^index\.php$ – [L]
# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ – [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
# END WordPress
=======================================================================
It looks fine. If it works, great. I’m not going to sort out the .htaccess for you, since it’s often a lot of trial and error and I’m neither on your server nor un-busy enough at the moment. I WILL suggest this. Separate the WordPress stuff from YOUR changes. Like this:
# For security reasons, Option followsymlinks cannot be overridden.
#Options +FollowSymLinks
Options +SymLinksIfOwnerMatch
AddType video/quicktime mp4,m4v
RewriteRule ^kmcdev/wheels/([^/]*)/([^/]*)/([^/]*)/$ http://www.wheelprosdev.com/kmcdev/wheels/?siteid=$1&groupid=$2&groupname=$3 [L]
#RewriteRule ^about/?([^/]*)/([^/]*)/$ http://www.wheelprosdev.com/about/?param1=$1¶m2=$2 [QSA,L]
#RewriteRule ^kmcdev/link/ rewrite.php?link=$1 [QSA,L]
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
# END WordPress
We have tried the above option but there was no luck. Still the issue persists. Let me know if this might be the server problem or is there any chance of any other issue?
Like I said:
it’s often a lot of trial and error
It’s probably the .htaccess code, you’ll need to research and play with it. Good luck.