ctcmedia Posted November 4, 2009 Share Posted November 4, 2009 I want to create a SEO friendly site and I have used mod rewrite(even though i dont know how to work it) to arrange the vars for me but as I am making custom functions I thought I would make a viewController and I want to use the following code <?php // Example URL http://localhost/page/227/more/772 $urlVar = explode("/",$HTTP_SERVER_VARS['PATH_INFO']); $page = $urlVar[1]; $extra = $urlVar[3]; ?> So what I am looking for is for the mod rewrite to just access the index.php and the php script will detect vars etc.... Is it possible? can you help? Thanks Paul Quote Link to comment https://forums.phpfreaks.com/topic/180277-mod-rewrite-one-php-file/ Share on other sites More sharing options...
Dragen Posted November 4, 2009 Share Posted November 4, 2009 One way of doing it would be to use mod_rewrite to set the vars as GET variables: RewriteRule ^page/([a-z0-9]+)/([a-z0-9]+)/?$ index.php?page=$1$extra=$2 [NC] Quote Link to comment https://forums.phpfreaks.com/topic/180277-mod-rewrite-one-php-file/#findComment-951241 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.