Activity Stream
48,167 MEMBERS
6952 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 5 of 5
  1.     
    #1
    Just Another Coder

    Default mod_rewrite fix

    Hello

    I have got the following mod_rewrite for my site.

    Code: 
    RewriteEngine On
    RewriteRule ^index\.html$ /index.php [L]
    RewriteRule ^([^/]*)\.html$ /videos/watch.php?id=135&video=$1 [L]
    The current url is
    Code: 
    http://domain.com/videos/watch.php?id=130&video=My-Ride-Rules-S01E06-HDTV-XviD-CRiMSON-
    I want it to be as
    Code: 
    http://domain.com/My-Ride-Rules-S01E06-HDTV-XviD-CRiMSON-.html
    Can someone guide me in fixing up the id=135 as it has to apply to all the ID's in the site.

    Thanks
    fdls Reviewed by fdls on . mod_rewrite fix Hello I have got the following mod_rewrite for my site. RewriteEngine On RewriteRule ^index\.html$ /index.php RewriteRule ^(*)\.html$ /videos/watch.php?id=135&video=$1 The current url is http://domain.com/videos/watch.php?id=130&video=My-Ride-Rules-S01E06-HDTV-XviD-CRiMSON- Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Respected Member
    Website's:
    DL4Everything.com Soft2050.in
    Use this one:

    PHP Code: 
    RewriteEngine On
    RewriteRule 
    ^index\.htmlindex.php [L]
    RewriteRule ^([^/]*)$ videos/watch.php?id=130&video=$[L
    It will work as you wanted

    That will work for:

    http://domain.com/videos/watch.php?i...-XviD-CRiMSON-
    http://domain.com/My-Ride-Rules-S01E...-XviD-CRiMSON-

    Edit:

    Just saw that you want with ids too, so this will work with id's:

    PHP Code: 
    RewriteEngine On
    RewriteRule 
    ^index\.htmlindex.php [L]
    RewriteRule ^([0-9]{4})-([^/]*)$ videos/watch.php?id=$1&video=$[L
    This will make the following url:

    http://domain.com/130-My-Ride-Rules-S01E06-HDTV-XviD-CRiMSON-

    To:

    http://domain.com/videos/watch.php?i...-XviD-CRiMSON-

    If you want without id, then you need to edit the script you are using and check for the tile in db with special chars removed

  4.     
    #3
    Just Another Coder
    Quote Originally Posted by soft2050 View Post
    Use this one:

    PHP Code: 
    RewriteEngine On
    RewriteRule 
    ^index\.html$ /index.php [L]
    RewriteRule ^([^/]*)$ /videos/watch.php?id=130&video=$[L
    It will work as you wanted
    But isn't that going to replace only for the 130th ID ? .html is also required at the end

  5.     
    #4
    Respected Member
    Website's:
    DL4Everything.com Soft2050.in
    Quote Originally Posted by fdls4all View Post
    But isn't that going to replace only for the 130th ID ? .html is also required at the end
    Check the above reply

    If you want .html at the end then:

    PHP Code: 
    RewriteEngine On
    RewriteRule 
    ^index\.htmlindex.php [L]
    RewriteRule ^([0-9]{4})-([^/]*).htmlvideos/watch.php?id=$1&video=$[L
    Works the same way as above just add .html at teh endz

  6.     
    #5
    Just Another Coder
    Quote Originally Posted by soft2050 View Post
    Check the above reply

    If you want .html at the end then:

    PHP Code: 
    RewriteEngine On
    RewriteRule 
    ^index\.htmlindex.php [L]
    RewriteRule ^([0-9]{4})-([^/]*).htmlvideos/watch.php?id=$1&video=$[L
    Works the same way as above just add .html at teh endz
    Thanks soft2050.

    I knew that way. But the thing is I didn't want the ID to interfere and now I realized script needs to be fixed to get it removed. Anyways thanks for helping mate

    Add this above code finally.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How can I enable Mod_Rewrite?
    By Areon in forum Server Management
    Replies: 0
    Last Post: 3rd Mar 2014, 01:26 PM
  2. Blocking spammers with mod_rewrite
    By NewEraCracker in forum Tutorials and Guides
    Replies: 11
    Last Post: 2nd Oct 2011, 05:19 PM
  3. Mod_rewrite access???
    By SaBteCh in forum Server Management
    Replies: 6
    Last Post: 18th Dec 2010, 01:09 AM
  4. mod_rewrite help
    By Paul in forum Webmaster Resources
    Replies: 1
    Last Post: 23rd Mar 2010, 12:02 AM

Tags for this Thread

BE SOCIAL