Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-02-2013, 05:24 PM   PM User | #1
withoutnick
New Coder

 
Join Date: Apr 2011
Posts: 22
Thanks: 1
Thanked 1 Time in 1 Post
withoutnick is an unknown quantity at this point
Easy htaccess condition

Hello, I am total begginer here. I would be grateful if you could help me.

I have this rewrite condition + rewrite.

RewriteCond %{REQUEST_URI} ^([^/]*).html$ [NC]
RewriteRule ^(.*).html$ index.php?page=$1 [L,QSA]

When i test it, i get page not found. Online regex tester, matches the result without no error.

The htaccess file is one level deeper than home dir: the address would be http://www.mydomain.com/regex_directory/

Thank you.
__________________
diplominiai darbai
withoutnick is offline   Reply With Quote
Old 02-02-2013, 06:54 PM   PM User | #2
withoutnick
New Coder

 
Join Date: Apr 2011
Posts: 22
Thanks: 1
Thanked 1 Time in 1 Post
withoutnick is an unknown quantity at this point
I did a modification to regex

Code:
RewriteCond %{REQUEST_URI} .([^/])*.html$ [NC]
RewriteRule ^(.*).html$		index.php?page=$1 [L,QSA]
Now it matches the request: mydomain.com/directory/index.html

But as well it matches and mydomain.com/directory/inde/x.html

$_GET variable page than is shown as inde/x?

What is wrong with my regex?
__________________
diplominiai darbai
withoutnick is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 06:39 PM.


Advertisement
Log in to turn off these ads.