Forum Moderators: phranque

Message Too Old, No Replies

RewriteRule with dot?

         

eK3eKyToPa

9:20 am on Jan 27, 2008 (gmt 0)

10+ Year Member



Please say what to do so that to be able to enter in for example
http://example.com/ex1.example
with this .htaccess you are able to use numbers,letters and - but not . [dot]. How to make it available?
Thanks!

****************
Options +FollowSymLinks
RewriteEngine on

RewriteRule ^([0-9A-Za-z\-]+)$ /index.php?city=$1 [L]
****************

eK3eKyToPa

4:04 pm on Jan 28, 2008 (gmt 0)

10+ Year Member



I tried
RewriteRule ^([0-9A-Za-z\-\.]+)$ /index.php?city=$1 [L]
But dont work at all
Please, really need this
For example:
/index.php?city=ala.bala
to be rewritten as
/ala.bala

jdMorgan

4:19 pm on Jan 28, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I use a pattern like this:

RewriteCond $1 !^index\.php$
RewriteRule ^([0-9a-z.\-]+)$ /index.php?city=$1 [NC,L]

The new RewriteCond is needed because "index.php" would otherwise match your new pattern, and this would lead to an endless rewriting loop.

Use [NC] to make the pattern compare case-insensitive, thus shortening the pattern and making the pattern-processing 30% more efficient.

Completely flush your browser cache before testing new code.

Jim

eK3eKyToPa

4:47 pm on Jan 28, 2008 (gmt 0)

10+ Year Member



now the dots are Ok
BUT the css files and pages that are in iframes dose not load

eK3eKyToPa

4:55 pm on Jan 28, 2008 (gmt 0)

10+ Year Member



OK
I get it :D