• Hi,

    I am developer and working in creating multisite wordpress site for wheels information. We are pulling wheels database from XML files and displaying on the site. On clicking a wheel we need to show the wheel ID in the URL instead of the the parameter URL. We have modified the .htaccess file to implement the same. However, it is not working and the URL is getting redirected to parameters.

    You can view the page at http://www.wheelprosdev.com/kmcdev/wheels/ click on any wheel image at the bottom, you will see the URL with parameters. Instead of that we need the URL to be displayed as http://www.wheelprosdev.com/kmcdev/wheels/KM1273 or http://www.wheelprosdev.com/kmcdev/wheels/KM1272

    I appreciate if anybody post the resolution for the above issue ASAP as we need to make the site LIVE once this issue is resolved.

    Thanks,
    ritwik

Viewing 8 replies - 1 through 8 (of 8 total)
  • 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.

    Thread Starter ritwik99

    (@ritwik99)

    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.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    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

    Thread Starter ritwik99

    (@ritwik99)

    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&param2=$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

    =======================================================================

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    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&param2=$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
    Thread Starter ritwik99

    (@ritwik99)

    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?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    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.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Friendly URLs’ is closed to new replies.