Welcome to WebmasterWorld Guest from 54.167.5.15

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Urgent Help required

its about URL Rewriting

     

hassanzobeen

9:39 am on Oct 26, 2010 (gmt 0)

5+ Year Member



Hello Every one I am in a great problem plz help me out

currently my site paths are something like this

domain.com/watch_video.php?v=2238HDRSN3NY

when I use SEO URL it becomes a directory type

I want to rewrite this page some thing like this

domain.com/watch?v=cCoQxfR2gWU

or
domain.com/video?v=cCoQxfR2gWU

I am adding my htaccess line for the url rewriting plz

change this line as I required for my site plzzz help me outttt plzzzzzzz


htaccess line
RewriteRule ^video/(.*)/(.*) watch_video.php?v=$1&%{QUERY_STRING} [L]

jdMorgan

3:53 pm on Oct 26, 2010 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



If you don't use the same "video id number" in the old and new URLs, then your site will quickly become difficult to maintain, and will get slower and slower every time you add a new video URL, because each new video will require an additional rewriterule.

Your example URLs above aren't consistent enough for me to diagnose the problem with your code, but note this important point: Mod_rewrite cannot change the links on your pages. All it can do is to detect requests for certain URLs, and pass those requests to your script with the URL-path information appended as name/value pairs.

The closest I can get is to take you example URLs and filepath above, but assume that the "video id number" does not change:

# Internally rewrite requests for "/video?x=y" to filepath "/watch_video.php?x=y"
RewriteRule ^video$ /watch_video.php [L]

Note that with this code, the "v=2238HDRSN3NY" query string is passed through the rule unchanged. As coded, this query string may contain arbitrary name/value pairs or it may be blank.

Jim
 

Featured Threads

Hot Threads This Week

Hot Threads This Month