Forum Moderators: phranque

Message Too Old, No Replies

rewrite rule for alias url

         

powerflash

4:57 pm on Nov 5, 2010 (gmt 0)

10+ Year Member



Is possible add a rewriterule on a exist rewriterule?

an example:

the url sito.ext/categoria/post.html is producted from rewriterule and I need make an alias url of this, like sito.ext/categoria/post/more.html

I can?

g1smd

7:32 pm on Nov 5, 2010 (gmt 0)

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



More than likely, yes.

powerflash

9:53 pm on Nov 5, 2010 (gmt 0)

10+ Year Member



ok, I tried with simple code :

RewriteRule ^(.+)/more.html$ /rw/$1.html&%{QUERY_STRING} [nc]
RewriteRule ^(.+).html$ /rw/index.php?path=$1&%{QUERY_STRING} [nc]

this work, but with wordpress htacces dont work


RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

jdMorgan

6:53 pm on Nov 29, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, you may have to exclude WP URLs from your new rules, or exclude the URLs used by the new rules from the WP rewrite, or both. This will depend on what order your rules are in, and whether the URLs are rewritten to "real" files by your two new rules, and a whole bunch of other details which you have not documented here.

It also depends on what you mean -exactly- by "does not work."

Jim