Forum Moderators: phranque

Message Too Old, No Replies

Help using 2 RewriteRules

Help using 2 RewriteRules

         

switchjohnny

8:35 pm on Sep 2, 2007 (gmt 0)

10+ Year Member



I'm using wordpress permalinks, and the code needed to display my SEO friendly urls is:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule . /index.php [L]
</IfModule>

Before using this rewriterule, I was using another one for a different program.

RewriteRule 1 /cgi-bin/index.pl [L]

If I put both the
RewriteRule . /index.php [L]
RewriteRule 1 /cgi-bin/index.pl [L]
together, they don't work.

Is there another way to combine these 2 rewriterules so they both work?

g1smd

9:25 pm on Sep 2, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



List which URLs you need the first redirect for, and then list all the URLs that the second redirect is needed for.

If the list is very long, then maybe list which ones they are not needed for.

Those will be the basis of the RewriteCond that you will need to set up for one or other, or maybe both of the redirects.

switchjohnny

10:00 am on Sep 4, 2007 (gmt 0)

10+ Year Member



the urls are dynamically generated for each rewrite.

I don't have a "list" for each url set.

g1smd

10:34 am on Sep 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



List the "types" or "formats", not the exact URL.... there will be thousands of URLs but only a few formats or types.

Look for commonality, and then craft a rule for that "type", not for all URLs.