Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

Use of assignment to $[ is deprecated at /usr/local/sbin/apxs line 86. , wwwxxx vim, mysql closing table and opening table, 800c5000, setgid operation not permitted, pciehp: acpi_pciehprm on IBM, WWWXXX.DBF, 078274121, info0a ip, should prodicers of software_based services be held liable or not liable for economic injuries

Links

XODOX
Impressum

#1: Apache HTTP mod_rewrite

Posted on 2008-04-10 05:23:14 by Rz

Hey All,

I am having issues with my regex in mod_rewrite.

I am trying to change my web sites URL format from this:
http://localhost/?section=sitemap
to this:
http://localhost/sitemap

The new format is working great at changing the new incoming URL
format from this http://localhost/sitemap to my index.php.

But I am having issues writing the old URL format (?section=sitemap)
to the new URL format (/sitemap).

Can someone please help if you have time?

Below are the regex's I am using right now at are working great.

RewriteEngine On
RewriteRule ^.*\.css$ - [L]
RewriteRule ^.*\.jpg$ - [L]
RewriteRule ^.*\.png$ - [L]
RewriteRule ^.*\.gif$ - [L]
RewriteRule ^robots* - [L]
RewriteRule ^.*\.ico$ - [L]
RewriteRule ^.*\.txt$ - [L]
RewriteRule ^.*\.xml$ - [L]
RewriteRule ^.*\.php$ - [L]
RewriteRule ^/([^/]*)/([^/]*) /index.php?section=$1/$2 [PT]
RewriteRule ^/([^/]*) /index.php?section=$1 [PT]

Report this message

#2: Re: Apache HTTP mod_rewrite

Posted on 2008-04-11 05:23:32 by Rz

On Apr 9, 11:23=A0pm, RZ <randallzap...@gmail.com> wrote:
> Hey All,
>
> I am having issues with my regex in mod_rewrite.
>
> I am trying to change my web sites URL format from this:http://localhost/?=
section=3Dsitemap
> to this:http://localhost/sitemap
>
> The new format is working great at changing the new incoming URL
> format from thishttp://localhost/sitemapto my index.php.
>
> But I am having issues writing the old URL format (?section=3Dsitemap)
> to the new URL format (/sitemap).
>
> Can someone please help if you have time?
>
> Below are the regex's I am using right now at are working great.
>
> RewriteEngine On
> RewriteRule ^.*\.css$ - [L]
> RewriteRule ^.*\.jpg$ - [L]
> RewriteRule ^.*\.png$ - [L]
> RewriteRule ^.*\.gif$ - [L]
> RewriteRule ^robots* - [L]
> RewriteRule ^.*\.ico$ - [L]
> RewriteRule ^.*\.txt$ - [L]
> RewriteRule ^.*\.xml$ - [L]
> RewriteRule ^.*\.php$ - [L]
> RewriteRule ^/([^/]*)/([^/]*) /index.php?section=3D$1/$2 [PT]
> RewriteRule ^/([^/]*) /index.php?section=3D$1 [PT]

I got it working. Thank you.

RewriteEngine On
RewriteRule ^.*\.css$ - [L]
RewriteRule ^.*\.jpg$ - [L]
RewriteRule ^.*\.png$ - [L]
RewriteRule ^.*\.gif$ - [L]
RewriteRule ^robots* - [L]
RewriteRule ^.*\.ico$ - [L]
RewriteRule ^.*\.txt$ - [L]
RewriteRule ^.*\.xml$ - [L]
RewriteRule ^.*\.php$ - [L]
RewriteCond %{QUERY_STRING} section
RewriteRule .* - [L]
RewriteRule ^/([^/]*)(?:/|%2F)([^/]*) /index.php?section=3D$1/$2 [PT]
RewriteRule ^/([^/]*) /index.php?section=3D$1 [PT]

Report this message