Buying .htaccess wordpress problem $7

Discussion in 'Programming' started by cebumedia, Jan 3, 2010.

  1. #1
    Summary of the problem:

    .htaccess file contents


    Note: I'm using wordpress.

    Post your solution here or PM it.
     
    Last edited: Jan 3, 2010
    cebumedia, Jan 3, 2010 IP
  2. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    As Seller:
    100% - 1
    As Buyer:
    100% - 1
    #2
    Try this...
    
    Options +FollowSymlinks
    
    RewriteEngine on
    
    RewriteBase /
    
    RewriteRule ^diary/([0-9]+)-([0-9]+)-([0-9]+) /diary/?e=$1-$2-$3 [NC]
    
    PHP:
     
    MyVodaFone, Jan 3, 2010 IP
  3. cebumedia

    cebumedia Active Member

    Messages:
    296
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    As Seller:
    100% - 0
    As Buyer:
    0.0% - 0
    #3
    Ok sorry for the confusion.

    Here's my .htaccess.


    This redirects properly but the URL in the address bar changes to the ugly URL.
     
    cebumedia, Jan 3, 2010 IP
  4. crivion

    crivion Notable Member

    Messages:
    1,669
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    210
    Digital Goods:
    3
    As Seller:
    100% - 3
    As Buyer:
    100% - 0
    #4
    remove those things from htaccess and simply go to admin->misscelaneous->permalinks
    write custom like
    %postdate%/%postname%
     
    crivion, Jan 3, 2010 IP
  5. cebumedia

    cebumedia Active Member

    Messages:
    296
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    As Seller:
    100% - 0
    As Buyer:
    0.0% - 0
    #5
    @crivion

    I know how to do that. You see what I'm trying to do is pass a variable string to a specific wordpress page. For example city/City1, city/City2 where city is the page and City1 & City2 are the variables.

    So domain.com/city/City1 redirects to domain.com/city?var=City1. The problem is domain.com/city?var=City1 shows up in the browser instead of domain.com/city/City1.

    Still haven't found the solution yet.
     
    cebumedia, Jan 3, 2010 IP
  6. meno

    meno Active Member

    Messages:
    121
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    60
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #6
    RewriteRule ^(.*)/city/([a-zA-Z_\s]+)$ http://www.domain.com/$1/?city=$2 [R=301,L]
    i think you just need play with "[R=301,L]", the prolem there...and make rewrite condition too...:)
     
    Last edited: Jan 3, 2010
    meno, Jan 3, 2010 IP
  7. krishmk

    krishmk Well-Known Member

    Messages:
    1,376
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    185
    As Seller:
    100% - 2
    As Buyer:
    100% - 0
    #7
    Last edited: Jan 3, 2010
    krishmk, Jan 3, 2010 IP
  8. pcshop899

    pcshop899 Peon

    Messages:
    345
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #8

    or



    It should work, if it does please send the payment to webmaster [at] techytuts . com
     
    pcshop899, Jan 3, 2010 IP
  9. cebumedia

    cebumedia Active Member

    Messages:
    296
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    As Seller:
    100% - 0
    As Buyer:
    0.0% - 0
    #9
    @krishmk and @pcshop899

    thanks but both of your solutions don't work. I think the problem is in the rewrite flag?

    Problem is still open.
     
    cebumedia, Jan 4, 2010 IP
  10. stOK

    stOK Active Member

    Messages:
    114
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #10
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteRule ^city/([a-zA-Z0-9_\s]+)$ city?var=$1

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .* /index.php [L]

    </IfModule>

    PM me plz
     
    Last edited: Jan 4, 2010
    stOK, Jan 4, 2010 IP
  11. atlantaazfinest

    atlantaazfinest Peon

    Messages:
    389
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #11
    The above solution should work because it includes the numbers and since City1 had a number the other rewrites didnt work
     
    atlantaazfinest, Jan 4, 2010 IP
  12. cebumedia

    cebumedia Active Member

    Messages:
    296
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    As Seller:
    100% - 0
    As Buyer:
    0.0% - 0
    #12
    @stok and @atlantaazfinest

    Thanks. However, the actual URL does not contain numbers at least the variable. The rewrite rule actually redirects fine as I've said in my first post. The only problem is that in the browser address bar, it turns back to something like /something/?variable=newyork. It should read like /something/city/newyork
     
    cebumedia, Jan 4, 2010 IP
  13. stOK

    stOK Active Member

    Messages:
    114
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #13
    Have you tried my solution ?
    You have to avoid using both absolute url and redirect flag.
     
    stOK, Jan 4, 2010 IP