SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 41
  1. #1
    SitePoint Zealot
    Join Date
    Jul 2008
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Change from PHP to ASP or ASPX

    Hello,

    I would like to fool my members with the website extension, Also i want to use the PHP format but in the browser i want to show another extension example ASP or ASPX,

    What should i do? any help would be thankful for.

    thanks

  2. #2
    SitePoint Zealot
    Join Date
    Jul 2008
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Now got it wit this code:

    Options +FollowSymlinks
    RewriteEngine on
    RewriteRule ^(.*)\.aspx$ $1.php [nc]


    But when they access the .php why does it not redirect them to .aspx?

    thanks in advance

  3. #3
    SitePoint Wizard
    Join Date
    Mar 2008
    Posts
    1,149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That "rewrites" .aspx to .php, but it won't redirect .php to .aspx.

    Options +FollowSymlinks
    RewriteEngine on
    RewriteRule ^(.*)\.aspx$ $1.php [NC,QSA,L]
    RewriteRule ^(.*)\.php$ http://yoururl.com/$1.aspx [NC,R=permanent,L]

  4. #4
    SitePoint Zealot
    Join Date
    Jul 2008
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I mean the link: http://localhost/test/index.php Works
    and this works too: http://localhost/test/index.aspx
    What should i do to let it only show .aspx?

  5. #5
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Why would you want to do such a thing?

    People don't care about file extentions - in fact, most decent websites nowadays use rewrites to change the url to a more friendly, extentionless url, i.e:
    Change
    site.com/view.php?somevar=abc&another=123
    to
    site.com/view/abc/123

    In fact, I think the only reason you could possibly have to fool a user into thinking it's aspx is if you're making the client think you're using dot-net technology - something which will financially ruin you when they find out (and they will).
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  6. #6
    SitePoint Zealot
    Join Date
    Jul 2008
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    how can they find out if i don't allow them to link to php files? thats why i want to delete the linking to php files.

  7. #7
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    If it's a client, they will find out. Websites don't just stay the same for years, most get updated every few years, some every few months.

    And it's not that likely that they'll ask you again, especially if it was a functionality upgrade. So another guy will come in to see the files, and tell them that you did it in PHP.

    A lawsuit would be immenent, especially because .net programmers are paid more.

    And he would probably have to rebuild the site in his language. Voila, your bank is empty.

    In business, honesty is an important factor.
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  8. #8
    SitePoint Zealot
    Join Date
    Jul 2008
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    why will this happen? What did i do to the will do like that? lol

  9. #9
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    .NET (i.e. aspx) programmers are more highly paid.

    PHP programmers aren't as highly paid.

    Would you like to buy a Ferrari to find out it's just a modded Toyota MR2?

    Not that PHP isn't better than ASPX, but that's the way it works.
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  10. #10
    SitePoint Zealot
    Join Date
    Jul 2008
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    looool what about .asp?

  11. #11
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Same.

    Why do you want to do this?

    PHP has a good rep for web building - look at Facebook and YouTube!
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  12. #12
    SitePoint Zealot
    Join Date
    Jul 2008
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I change now, YouTube using PHP? Wow, ok then how can i use a link look like that: www.fgfgf.com/article

    instead of this: www.fgfgf.com/article.php

    a little chnage to the code above?

    like YouTube please

  13. #13
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Simple!

    Code:
    RewriteEngine On
    RewriteRule ^(.*)$ /$1.php [QSA]
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  14. #14
    SitePoint Zealot
    Join Date
    Jul 2008
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    not work sorry

  15. #15
    SitePoint Wizard silver trophybronze trophy Stormrider's Avatar
    Join Date
    Sep 2006
    Location
    Nottingham, UK
    Posts
    3,133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    php is making a comeback now... .net has just been the 'trend' in the past few years, but look at what sites use php:

    Yahoo (it was revealed a while ago i think)
    Youtube
    Facebook
    BBC is to start using Zend Framework with a Java back end

    Shuts up the people who say php isn't good for massive sites

  16. #16
    SitePoint Zealot
    Join Date
    Jul 2008
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Stormrider View Post
    php is making a comeback now... .net has just been the 'trend' in the past few years, but look at what sites use php:

    Yahoo (it was revealed a while ago i think)
    Youtube
    Facebook
    BBC is to start using Zend Framework with a Java back end

    Shuts up the people who say php isn't good for massive sites
    Wow you made my day, But how can we hide the .php ? like YouTube:
    http://www.youtube.com/watch?v=bA_7oQPQe3Q

    the real URL is:
    http://www.youtube.com/watch.php?v=bA_7oQPQe3Q

  17. #17
    SitePoint Zealot
    Join Date
    Apr 2008
    Posts
    171
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Damn, just code in ASP.NET and it will be much better, and you'll get your extension also

  18. #18
    SitePoint Zealot
    Join Date
    Jul 2008
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hehe, Asking again how can we hide the .php ? like YouTube:
    http://www.youtube.com/watch?v=bA_7oQPQe3Q

    the real URL is:
    http://www.youtube.com/watch.php?v=bA_7oQPQe3Q

    Thanks

  19. #19
    SitePoint Wizard silver trophybronze trophy Stormrider's Avatar
    Join Date
    Sep 2006
    Location
    Nottingham, UK
    Posts
    3,133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You can either use mod_rewrite, or map the different extension to run as php, as above. I dunno about all this heavy financial stuff Jake was on about - I don't see how that comes into it? You can do what you like with extensions, noone can 'get' you for it - presumably you aren't doing this to hide it from a client though, which would be bad.

  20. #20
    SitePoint Zealot
    Join Date
    Jul 2008
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so what should i do now? use ASPX?

  21. #21
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, please.

  22. #22
    SitePoint Wizard silver trophybronze trophy Stormrider's Avatar
    Join Date
    Sep 2006
    Location
    Nottingham, UK
    Posts
    3,133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    No, you can use whatever language you want, and have whatever extension you want. As long as you aren't doing it to make the client think you used one language when you actually used another.

  23. #23
    SitePoint Zealot
    Join Date
    Jul 2008
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Please read this article: http://roshanbh.com.np/2008/01/hidin...extension.html

    To see why i want to change the extension, It is better for us also.

  24. #24
    SitePoint Wizard silver trophybronze trophy Stormrider's Avatar
    Join Date
    Sep 2006
    Location
    Nottingham, UK
    Posts
    3,133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    It isn't a foolproof security method, since PHP sends out HTTP headers identifying itself anyway. It might be 1 layer in a multi layered security approach, but it is by no means the only thing you should do to secure your code.

    That article also answers the question of how to do it anyway!

  25. #25
    SitePoint Zealot
    Join Date
    Jul 2008
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    wow now i have got those extensions: .asp, .jsp, .do, .aspx and .php

    Which 1 should i use?


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
  •