homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

Urgent Help required
its about URL Rewriting

Msg#: 4222116 posted 9:39 am on Oct 26, 2010 (gmt 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]



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

Msg#: 4222116 posted 3:53 pm on Oct 26, 2010 (gmt 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.


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved