RE: [users@httpd] modRewrite looks in the wrong subfolder: http://localhost/module/News/article/56.html => http://localhost/index.php?module=News&article=56

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Why don't you try this instead:

        RewriteRule ^/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^\./]+)\.html?$ /index.php?$1=$2&$3=$4&$5 [L]
        RewriteRule ^/([^/]+)/([^/]+)/([^/]+)/([^\./]+)\.html?$ /index.php?$1=$2&$3=$4 [L]
        RewriteRule ^/([^/]+)/([^/]+)/([^\./]+)\.html?$ /index.php?$1=$2&$3 [L]
        RewriteRule ^/([^/]+)/([^\./]+)\.html?$ /index.php?$1=$2 [L]

I was not able to reproduce your problem, but part of it was that . in a regexp matches even /

-ascs 

-----Original Message-----
From: Bernd Muent [mailto:Bernd.Muent@xxxxxxxxxxxxx] 
Sent: Tuesday, April 11, 2006 10:47 AM
To: users@xxxxxxxxxxxxxxxx
Subject: [users@httpd] modRewrite looks in the wrong subfolder: http://localhost/module/News/article/56.html => http://localhost/index.php?module=News&article=56

Hi together,
I'd like the following for a CMS:
URL http://localhost/module/News/article/56/show/1.html
will be rewrited to
http://localhost/index.php?module=News&article=56&show=1

 From the PHP site, it's easy to explode the querystring and prepare the 
right link.

When I click the first time on:
http://localhost/module/News/article/56/show/1.html
everything is ok, but then the link becomes the following:

http://localohost/module/News/article/56/show/1/module/News/article/56/show/1.html

So Apache thinks that "module/News/article/56/show/" is the current 
folder and he is looking in this subfolder.
After that I get either a 404 or embedded pictures are not found.

My rewrite rules are the following:
RewriteRule ^(.*)/(.*)(\.html?)$ /index.php?$1=$2 [L]
RewriteRule ^(.*)/(.*)/(.*)(\.html?)$ /index.php?$1=$2&$3 [L]
RewriteRule ^(.*)/(.*)/(.*)/(.*)(\.html?)$ /index.php?$1=$2&$3=$4 [L]
RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)(\.html?)$ 
/index.php?$1=$2&$3=$4&$5 [L]
etc.

I tried the following too:
RewriteBase /

But nothing has changed.

Thank you for tips, Bernd

-- 
Bernd Münt                   Durchwahl: 030/69032-509
euroscript Deutschland GmbH  Zentrale:  030/69032-300
Abteilung IT-Management      Fax:       030/69032-505
Alt-Moabit 91                Mail:      Bernd.Muent@xxxxxxxxxxxxx
10559 Berlin                 Web:       http://www.euroscript.de

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux