Forum Moderators: phranque
AddType application/x-httpd-php .htm .html
if word "ebay" or word "archives" in URI then Do this
*****************************************************
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteRule ebay /help/support.pl
RewriteRule archives /fina/home.pl
### This will change all spaces in URI to dashes
RewriteCond %{REQUEST_URI} ^(.*)\ (.*)$
RewriteRule ^.*$ %1-%2 [E=space_replacer:%1-%2]
RewriteCond %{ENV:space_replacer}!^$
RewriteCond %{ENV:space_replacer}!^.*\ .*$
RewriteRule ^.*$ %{ENV:space_replacer} [R=301,L]
Else Do this
**********************************
## This junk is required to run Blog Solutions
Options +FollowSymlinks
RewriteEngine On
RewriteRule ^fina(.*)$ - [L]
RewriteRule ^help(.*)$ - [L]
RewriteRule ^manage(.*)$ - [L]
RewriteRule ^batch(.*)$ - [L]
RewriteRule ^export(.*)$ - [L]
RewriteRule ^templates(.*)$ - [L]
RewriteRule ^favicon\.ico(.*)$ - [L]
RewriteRule ^robots\.txt$ - [L]
RewriteRule ^plain\.php$ - [L]
RewriteRule ^(.*)$ index.php
Thanks for any help....
The space replacer above works great but when the BS stuff is inserted the space replacer won't work... I think if I could operate them depending on if statement all would work... but not sure how to use the if statement in htaccess..
That space replacer code looks very complicated for what it needs to do, BTW, and it also looks like it will only fix a single space.
Jim
The replacer works great on an unlimited number of words...for example /ebay/my-real-estate-network-team-in-Florida.htm
Try it you might like to put it in your tool box of tricks..
I just have no idea how to structure what you said... let me try here and maybe you can get me on the right track....
eample of a URI that needs to be processed...
on the web page <a href="ebay/my car for sale.htm">my car for sale</a>
/ebay/my car for sale.htm (on the web page and clicked.)
/ebay/my-car-for-sale.htm (what you see in the browser line.)
Can I do something like this...
RewriteCond %{REQUEST_URI} ^ebay [or]
RewriteCond %{REQUEST_URI} ^archives
#now add all the top lines here
RewriteCond %{REQUEST_URI} ^!ebay [or]
RewriteCond %{REQUEST_URI} ^!archives
#now add all the bottom lines here
As you can see I have not idea what I am doing here... just groping for straws with the hope someone can see what I am attempting to do and bail me out...
Nevertheless, to answer the main question:
Add a RewriteCond to allow the first ruleset to take action only for 'ebay' or 'archives.' Then add a negative condition to prevent the blog stuff from taking action for 'ebay' or 'archives':
## This will change all spaces in URI to dashes
[b]RewriteCond %{REQUEST_URI} ebay¦archives[/b]
RewriteCond %{REQUEST_URI} ^(.*)\ (.*)$
RewriteRule ^.*$ %1-%2 [E=space_replacer:%1-%2]
RewriteCond %{ENV:space_replacer}!^$
RewriteCond %{ENV:space_replacer}!^.*\ .*$
RewriteRule ^.*$ http://www.example.com%{ENV:space_replacer} [R=301,L]
#
## This junk is required to run Blog Solutions
[b]RewriteCond %{REQUEST_URI} [i][/i]!(ebay¦archives)[/b]
RewriteCond %{REQUEST_URI} !^/(fina¦help¦manage¦batch¦export¦templates¦favicon\.ico$¦robots\.txt$¦plain\.php$)
RewriteRule ^(.*)$ index.php
Replace all broken pipe "¦" characters above with solid pipe characters before use; Posting on this forum modifies the pipe characters.
Jim