+ Reply to Thread
Results 1 to 5 of 5

Thread: Change page names in URL

  1. #1
    luca85 is offline x10Hosting Member luca85 is an unknown quantity at this point
    Join Date
    Nov 2009
    Posts
    24

    Question Change page names in URL

    Hi,

    First of all I hope I posted this in the right section. If not, please forgive me.

    Secondly, I made a website using Reptile and is hosted here on x10. I don't know a lot about programing but I would like to do this little thing:

    Change this URL that shows up when I'm on the Contact page

    http://www.NAME.com/index.php?p=1_2_Contact

    to

    http://www.NAME.com/Contact

    Also I would like to do this for all the pages.

    Should I change some names in cPanel?

    Any pointers will be appreciated.

    Thanks.

  2. #2
    techairlines's Avatar
    techairlines is offline x10 Flyer techairlines has much to be proud oftechairlines has much to be proud of
    Join Date
    Jul 2009
    Location
    New York City
    Posts
    2,853

    Re: Change page names in URL

    Try adding a file called .htaccess (hidden dot file) into your public_html root directory. To do this, simply create a blank txt file and rename it into .htaccess (no name, only a file extension). If you're doing this from inside cPanel, make sure you have Hidden Files checked off.

    Then inside, add the following lines:

    Code:
    RewriteEngine On 
    RewriteRule ^contact/?$ index.php?p=1_2_Contact [NC,L]
    This is known as a basic URL mod_rewrite.
    Last edited by techairlines; 07-27-2010 at 03:41 PM.
    Best regards,
    Brian Yang - TechAirlines


    How am I doing? Click the star button at the bottom left to rate this post. Thanks.
    Terms of Service | Account Portal | Wiki

  3. #3
    luca85 is offline x10Hosting Member luca85 is an unknown quantity at this point
    Join Date
    Nov 2009
    Posts
    24

    Re: Change page names in URL

    Thanks for the reply.

    I already have that file in public_html and it looks like this
    __________________________________________________ _______________
    RewriteEngine on

    # -FrontPage-

    IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

    <Limit GET POST>
    order deny,allow
    deny from all
    allow from all
    </Limit>
    <Limit PUT DELETE>
    order deny,allow
    deny from all
    </Limit>
    AuthName NAME.com (edited)
    AuthUserFile /home/NAME/public_html/_vti_pvt/service.pwd (edited)
    AuthGroupFile /home/NAME/public_html/_vti_pvt/service.grp (edited)

    RewriteCond %{HTTP_HOST} ^NAME$ [OR] (edited)
    RewriteCond %{HTTP_HOST} ^www.NAME.com$ (edited)
    RewriteRule ^/?$ "NAME" [R=301,L] (edited)
    RewriteRule ^contact/?$ index.php?p=1_2_Contact [NC,L] (added now)
    __________________________________________________ _________________

    I have added the last line to the file and saved it but nothing happened to the website's URL.

    Should I change something else in there?

  4. #4
    luca85 is offline x10Hosting Member luca85 is an unknown quantity at this point
    Join Date
    Nov 2009
    Posts
    24

    Re: Change page names in URL

    Still haven't found a solution to this thing.

  5. #5
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Change page names in URL

    Did you try the URL?

    Note that the rewrite engine lets you access a given resource with a given URL. In no way does it alter the source of web pages; you'll have to do that on your own. If you're using something to generate your pages, it limits how much you can change. Read through the mod_rewrite documentation to learn exactly what its capabilities are.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

+ Reply to Thread

Similar Threads

  1. HELP Change Web Page
    By afroclocks in forum Graphics & Webdesign
    Replies: 4
    Last Post: 06-03-2009, 09:41 PM
  2. 404 page change.
    By XGI Admin in forum Free Hosting
    Replies: 1
    Last Post: 05-06-2008, 04:47 PM
  3. Where to change the look of my web page
    By KSclans in forum Free Hosting
    Replies: 22
    Last Post: 11-22-2007, 11:43 PM
  4. How do i change my web page?
    By james92 in forum Free Hosting
    Replies: 2
    Last Post: 09-23-2007, 04:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers