.htaccess mod_rewrite rules

Discussion in 'Water Cooler' started by John, Jun 9, 2009.

  1. John

    John Regular Member

    757
    87
    394
    Don't really know were to post this but I need some help with .htaccess mod_rewrite because I do not know how it should look.


    I want following links to be rewritten.

    home.php >> x/
    api.php?create=[VALUE] >> x/api/create/[VALUE]/
    api_example.php >> x/api/example/
    dashboard/login.php >> x/dashboard/login/
    dashboard/signup.php >> x/dashboard/signup/
    dashboard/logout.php >> x/dashboard/logout/
    dashboard/index.php >> x/dashboard/
    dashboard/index.php?page=newshortlink >> x/dashboard/new/
    dashboard/index.php?page=account >> x/dashboard/account/
    dashboard/index.php?page=delshortlink >> x/dashboard/delete/
    dashboard/index.php?page=del&action=delete&id=[VALUE] >> x/dashboard/delete/[VALUE]/

    Hope someone that is good on this can help me.
     
  2. Bundy

    Bundy Admin Talk Staff

    842
    36
    664
    Edit...be right back...


    I typed something else then realized it wasn't what I or you wanted. Here is another tool that may help you...

    http://www.htaccesstools.com/ But I don't think it will.. :( Sorry.
     
  3. John

    John Regular Member

    757
    87
    394
    Okay. Do not know why it stands edit but I guess you will help me with this and if that is the case thank you very much :)
     
  4. John

    John Regular Member

    757
    87
    394
    Ok :( Thanks anyway. Maybe someone else is good at this and can help me with this?
     
  5. Bundy

    Bundy Admin Talk Staff

    842
    36
    664
    This might help you but you may need to be logged in or be part of vbseo?

    vBulletin SEO Forums

    You are looking for rewrites right?
     
  6. John

    John Regular Member

    757
    87
    394
    Yes I am looking for rewrites but this is not for any vbulletin forum or anything like that its for an website only.
     
  7. Bundy

    Bundy Admin Talk Staff

    842
    36
    664
    That should still help you then.
     
  8. John

    John Regular Member

    757
    87
    394
    Thanks for that one but it doesn't work. just get an 500 error page when i put the rewrite rule in my .htaccess file.
     
  9. Nick

    Nick Regular Member

    7,441
    218
    458
    What exactly did you put in your .htaccess? Can you paste the code here? Thanks. ;)
     
  10. John

    John Regular Member

    757
    87
    394
    This is what I put in the .htaccess file.

    RewriteEngine on

    RewriteRule 'home\.php=(.*?)$' => 'x/'
     
  11. John

    John Regular Member

    757
    87
    394
    Anyone that can help me with this?
     
  12. brad@codeworks

    brad@codeworks Newcomer

    1
    0
    33
    RewriteRule ^x(/?)$ home.php [NC,L]

    The (/?) says it can have a / but doesnt have to. NC is no case
     

Share This Page