WordPress.org

Ready to get started?Download WordPress

Forums

ASPX dynamic redirecct to wordpress ? htacess (5 posts)

  1. tayssir.ch
    Member
    Posted 10 months ago #

    Hello,
    can you help me to find htacess code to redirect this url http://www.mywebsite.com/Auto/UI/CMS.aspx?id=119&lang=ar to http://www.mywebsite.com/?p=199&lang=ar
    199 is the post id Thanks

  2. Master Jumblespeed
    Member
    Posted 10 months ago #

    Hi.

    If you wanted to redirect just that file then this code can go in the .htaccess of your root:

    # Redirect the file
    Redirect /Auto/UI/CMS.aspx?id=119&lang=ar http://YOUR_SITE_HERE.com/?p=199&lang=ar
    
    # Prevent viewing of .htaccess file
    <Files .htaccess>
    order allow,deny
    deny from all
    </Files>

    (The second part prevents viewing of the .htaccess; I prefer using that, but you can remove it if you'd prefer.)

    Of course replace the YOUR_SITE_HERE.com with your site domain.

    Also note that if you change your permalinks this will no longer work as it will redirect to the old permalink.

    Please correct me if my syntax is incorrect.

  3. tayssir.ch
    Member
    Posted 10 months ago #

    thanks for your quick reply, but no i need to redirect all Post ID not only 199,
    sorry but aslo i test ur code isn't working too for id 199

  4. Master Jumblespeed
    Member
    Posted 10 months ago #

    Let me back up one-
    I see you have WordPress on the http://www.mywebsite.com/?p=199&lang=ar directory but what do you have on the http://www.mywebsite.com/Auto/UI/CMS.aspx?id=119&lang=ar one?

  5. tayssir.ch
    Member
    Posted 10 months ago #

    its a aspx, for a x developer,
    i convert the website database to wodpress and i move all post
    and each post has same id , so i want to redirect all link to the new links

Reply

You must log in to post.

About this Topic