Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Urgent Help required

its about URL Rewriting

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

New User

5+ Year Member

joined:May 29, 2010
posts: 29
votes: 0

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

currently my site paths are something like this


when I use SEO URL it becomes a directory type

I want to rewrite this page some thing like this



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]
3:53 pm on Oct 26, 2010 (gmt 0)

Senior Member

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

joined:Mar 31, 2002
votes: 0

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.