+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 10 of 18

Thread: Mod Rewrite

  1. #1
    webman1 is offline Coder webman1 will become famous soon enough
    Join Date
    Sep 2007
    Posts
    85

    Default Mod Rewrite

    Hi Folks,

    I have a few php pages that i want to convert to normal html through Mod Rewrite

    e.g.

    http://www.site.com/index.php?page=new&cid=999 will change to http://www.site.com/bicycles.html

    If i implement this, will my site lose ranking in Google for the existing link?

    Thanks,
    S

  2. #2
    paul's Avatar
    paul is offline ninja SEO paul has much to be proud of paul has much to be proud of paul has much to be proud of paul has much to be proud of paul has much to be proud of paul has much to be proud of paul has much to be proud of paul has much to be proud of paul has much to be proud of paul has much to be proud of
    Join Date
    Dec 2006
    Location
    .de
    Posts
    1,277

    Default

    In one word. No*

    *Use a 301 redirect and you will be okay.

  3. #3
    webman1 is offline Coder webman1 will become famous soon enough
    Join Date
    Sep 2007
    Posts
    85

    Default

    Use Mod Rewrite and a 301?

  4. #4
    paul's Avatar
    paul is offline ninja SEO paul has much to be proud of paul has much to be proud of paul has much to be proud of paul has much to be proud of paul has much to be proud of paul has much to be proud of paul has much to be proud of paul has much to be proud of paul has much to be proud of paul has much to be proud of
    Join Date
    Dec 2006
    Location
    .de
    Posts
    1,277

    Default

    in your .htaccess file
    Redirect 301 /oldpage.html http://www.yoursite.com/newpage.html
    Redirect 301 /oldpage2.html http://www.yoursite.com/folder/
    Redirect 301 /index.php?page=new&cid=999 /bicycles.html

  5. #5
    webman1 is offline Coder webman1 will become famous soon enough
    Join Date
    Sep 2007
    Posts
    85

    Default

    So i just input one line like below and this will work?

    Redirect 301 /index.php?page=new&cid=999 /bicycles.html

    The index.php?page=new&cid=999 page is generated from a CMS php package so will always have to exist i presume and bicycles.html is nonexistant at present.

    Do i have to create a blank bicycle.html file first or similar and then use redirect?

    I thought Mod Rewrite would be used as i really only want to change the URL of the php page to a more user friendly name

    OR AM I JUST TOTALLY BAFFLED

  6. #6
    blacknight's Avatar
    blacknight is offline Web Slave blacknight is a splendid one to behold blacknight is a splendid one to behold blacknight is a splendid one to behold blacknight is a splendid one to behold blacknight is a splendid one to behold blacknight is a splendid one to behold blacknight is a splendid one to behold blacknight is a splendid one to behold
    Join Date
    Jan 2006
    Location
    Ireland
    Posts
    7,890

    Default

    mod_rewrite makes the browser "think" that the file exists - if you look at the URLs on this site 99% of them are generated using mod_rewrite

    The only "real" pages are ones like index.php, newreply.php etc., all the others are just mod_rewrite magic

    So, no. You don't need to create blank files. In fact if you do you'll break it

  7. #7
    webman1 is offline Coder webman1 will become famous soon enough
    Join Date
    Sep 2007
    Posts
    85

    Default

    Thanks guys

    So is this all i need to input in my .htaccess file to change the file url to bicycles.html

    Redirect 301 /index.php?page=new&cid=999 /bicycles.html

    Is Redirect 301 a Mod Rewrite command so? Sorry, i sound like a DOS Command Line old boy

  8. #8
    blacknight's Avatar
    blacknight is offline Web Slave blacknight is a splendid one to behold blacknight is a splendid one to behold blacknight is a splendid one to behold blacknight is a splendid one to behold blacknight is a splendid one to behold blacknight is a splendid one to behold blacknight is a splendid one to behold blacknight is a splendid one to behold
    Join Date
    Jan 2006
    Location
    Ireland
    Posts
    7,890

    Default

    No. You're confusing two things

    A redirect is a redirect ie. it tells apache that content has moved from one place to another (301 permanently, 302 temporary etc.,)

    The rewrite rule can do both, but it's not as simple as the one you provided

    You might find the mod_rewrite cheatsheet helpful

  9. #9
    webman1 is offline Coder webman1 will become famous soon enough
    Join Date
    Sep 2007
    Posts
    85

    Default

    Thanks BK

    I need to look up rewrite so.

    Thanks for the tip. Will google mod_rewrite cheatsheet now and have a look

  10. #10
    blacknight's Avatar
    blacknight is offline Web Slave blacknight is a splendid one to behold blacknight is a splendid one to behold blacknight is a splendid one to behold blacknight is a splendid one to behold blacknight is a splendid one to behold blacknight is a splendid one to behold blacknight is a splendid one to behold blacknight is a splendid one to behold
    Join Date
    Jan 2006
    Location
    Ireland
    Posts
    7,890

+ Reply to Thread
Page 1 of 2
1 2 LastLast

Similar Threads

  1. Installing ISAPI Rewrite
    By glengara in forum Server / Technical Administration Tips and Queries
    Replies: 4
    Last Post: 01-10-2007, 11:38 AM
  2. Welcome panel rewrite
    By wheres me jumpa in forum Forum Management
    Replies: 2
    Last Post: 09-09-2007, 02:01 PM
  3. Wordpress .htaccess file for no-www and mod-rewrite()
    By Cormac in forum Blogs & Blogging
    Replies: 9
    Last Post: 20-03-2007, 09:31 AM

Tags for this Thread

Posting Permissions

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

Search Engine Optimization by vBSEO

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64