SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: htaccess

  1. #1
    SitePoint Zealot
    Join Date
    Mar 2005
    Posts
    144
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    htaccess

    hi,

    i would like to send my users clicking on
    www.mysite.com/page_1243423423.php to
    www.mysite.com/profile-name.php

    is it possible to do this with htaccess ?
    if so what should i write into the file?

    thanks

  2. #2
    SitePoint Guru alecrust's Avatar
    Join Date
    Jun 2007
    Location
    London, UK
    Posts
    728
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to give more information.

    A very simple .htaccess redirect is simply:
    Code:
    Redirect http://www.mysite.com/page_1243423423.php http://www.mysite.com/profile-name.php
    But I'm assuming you want something more in depth than that?
    Honda Civic Forum - UK Civic Forum
    Web Host Reviews - Independent, honest host reviews
    My Portfolio - Simplicity is the ultimate sophistication

  3. #3
    SitePoint Zealot
    Join Date
    Mar 2005
    Posts
    144
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by alecrust View Post
    You need to give more information.

    A very simple .htaccess redirect is simply:
    Code:
    Redirect http://www.mysite.com/page_1243423423.php http://www.mysite.com/profile-name.php
    But I'm assuming you want something more in depth than that?
    what does it mean more in dept?

  4. #4
    SitePoint Guru alecrust's Avatar
    Join Date
    Jun 2007
    Location
    London, UK
    Posts
    728
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It means if you place that code in your ".htaccess" file in your site's root, it will redirect all traffic (including search engines) from the first URL to the second)

    But I need more information from you on exactly what you want to achieve.
    Honda Civic Forum - UK Civic Forum
    Web Host Reviews - Independent, honest host reviews
    My Portfolio - Simplicity is the ultimate sophistication

  5. #5
    SitePoint Zealot
    Join Date
    Mar 2005
    Posts
    144
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  6. #6
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,653
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    acqua,

    I'm not sure whether mod_alias (the Redirect module) will keep the REAL URL hidden because it requires an absolute URL for the redirection.

    mod_rewrite will, however, so your request is for:
    Code:
    RewriteEngine on
    RewriteRule ^/?profile-name\.php$ page_1243423423.php [L]
    I think what Alec was alluding to was that such a simple redirect is NOT the norm so, if you were looking for other redirects to be handled with this code, it will not happen because there is no way to map profile-name to page_1243423423.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


Bookmarks

Posting Permissions

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