Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2006
    Posts
    1,765

    Exclamation Using mod_rewrite

    Hi, I have mod-rewrite installed and working on my Linux box.

    I have an existing file located at www.domain.com/page1.php, I would like for its URL to be shown as www.domain.com/page1/ using mod_rewrite.

    I have tried a few things such as:
    Code:
    RewriteEngine on
    RewriteRule page1.php /page1/
    Which only brings up a /page1/ cannot be found message.

    Any ideas?

  2. #2
    Join Date
    May 2006
    Location
    India
    Posts
    661
    Use the following piece of code. That makes the url www.domain.com/page1/ valid.
    Code:
    RewriteEngine on
    RewriteRule ^page1/$ /page1.php
    SparkSupport.Com - The Premier Tech Company
    Cloud Solutions|Email Infra setup|VOIP|Video Streaming|Software Development
    Email: [email protected] Phone : 1- 408-600-1449 | Skype : shijils

  3. #3
    Join Date
    Jun 2006
    Posts
    1,765
    Thanks for that - it worked

    Do you have anything else I could add so that the file can ONLY be obtained at the new URL or it shows a 404 error page? (assuming I have a 404 page at 404.php)?

    Thanks

Posting Permissions

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