www.webdeveloper.com
Results 1 to 3 of 3

Thread: URL Rewriting Conundrum

  1. #1
    Join Date
    Feb 2006
    Posts
    7

    Angry URL Rewriting Conundrum

    Hi all,

    Myself and 2 other developers have been struggling to get a rewrite rule working.

    The clients old site used ASP.Net and we need to convert old urls to our new system.

    Basically the rule needs to convert:

    /web/Page1.aspx?PageID=100 to: /page/_100

    the only important variable is the PageID however there will be variations on the aspx page called, but only Page1.aspx, Page2.aspx and Page3.aspx.

    If anyone can help with the re-write rule it would be hugely appreciated.

    Cheers

    Dan

  2. #2
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    It seems like this should work:
    Code:
    RewriteEngine On
    RewriteBase /
    RewriteRule ^/web/Page[0-9][.]aspx?PageID=([0-9]+)   /page/_$1  [L]
    Jon Wire

    thepointless.com | rounded corner generator

    I agree with Apple. Flash is just terrible.

    Use CODE tags!

  3. #3
    Join Date
    Sep 2004
    Posts
    398
    Are you using mod_rewrite or something for IIS?
    Is it in a .htaccess file?

    Try
    Code:
    Options +FollowSymLinks
    
    RewriteEngine On
    
    RewriteCond %{QUERY_STRING} ^(.*&)?PageID=([0-9]+)(&.*)?$ [NC]
    RewriteRule ^web/Page1\.aspx$ /page/_%2? [NC,R=301,L]

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles