This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: Friendly url’s, please help Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
thestone
Newbie
Newbie


Joined: 30 December 2009
Online Status: Offline
Posts: 1
Posted: 31 December 2009 at 3:15am | IP Logged Quote thestone

Hi people,

I can't find the solution for my problem:

I want to rewrite url:

www.abc.com/contact/     -> to www.abc.com/index.php?MenuId=contact
www.abc.com/porfolio/map1/ ->www.abc.com/index.php?MenuId=portfolio&SubMenu=map1

all the seourl are corresponding to a page/subpage in MySQL. I also have a www.abc.com/cms/ (real map in my www root) which i don't want to rewrite. So if it is directory in my www_root it should get into the directory and else it should rewrite.

My .htacces look like this:

<IfModule mod_rewrite.c>

   # Enable
   Options +FollowSymlinks
   RewriteEngine On

 

   # Root folder
   RewriteBase /

   #Exeptions
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l

   # Redirect URLs ending in /index.php or /index.html to /
   RewriteCond %{THE_REQUEST} ^GET\ .*/index\.(php|html?)\ HTTP
   RewriteRule ^(.*)index\.(php|html?)$ $1 [R=301,L]

   # Redirect submenu
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule ^(.*)/(.*)/ index.php?MenuId=$1&SubMenu=$2 [L]  


   # Redirect / menu_id
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule ^(.*)/ index.php?MenuId=$1 [L]



   # Rewrite requests for sitemap.xml
   RewriteRule ^sitemap.xml$ /presentation/sitemap.php?target=google [L]
   # Rewrite requests for urllist.txt
   RewriteRule ^urllist.txt$ /presentation/sitemap.php?target=yahoo [L]


</IfModule>

thnks in advanced

The stone
Back to Top View thestone's Profile Search for other posts by thestone
 
Vyacheslav
Admin Group
Admin Group


Joined: 02 July 2008
Location: Ukraine
Online Status: Offline
Posts: 1542
Posted: 05 January 2010 at 10:54am | IP Logged Quote Vyacheslav

Hello,
I'm sorry for delay. We had holidays.

Please try the following conditions before each of those RewriteRule statements which shouldn't match real folders:
Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-f


__________________
Slavik Shynkarenko,
Helicon Tech.
Back to Top View Vyacheslav's Profile Search for other posts by Vyacheslav Visit Vyacheslav's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum