Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 3rd Feb 2013, 02:10 AM   #1
Warrior Member
 
Join Date: 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default
htaccess mod rewrite's condition
Share on: 
fb share twitter share gplus share more share

Hello,

I am working on SEF URLs, but since my knowledge of regex is far too short, I came up with a situation where I am not able to find a solution on my own.

Code:
RewriteCond %{REQUEST_URI} .([^/])*.html$ [NC]
RewriteRule ^(.*).html$        index.php?page=$1 [L,QSA]
In words, my rewrite condition would be like: match everything, that don't have slash sign before ".html". The problem is that this rewrites me everything!
For example: mydomain.com/page.html would give $_GET['page'] = 'page' and mydomain.com/pa/ge.html would give $_GET['page'] = 'pa/ge'.

Maybe someone would be able to edit my regex and explain what I am doing wrong.

Thank you!

withounick is offline  
Closed Thread


Bookmarks

Tags
condition, htaccess, mod, rewrite


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 04:56 AM.